0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Access メモ フォーム内のテキストボックスをクリア

Last updated at Posted at 2019-10-25

すぐ忘れるので、自分用にメモ

フォーム内のテキストボックスをクリアする

Private Sub cmdClear_Click()
'[クリア]ボタンクリック時

  Dim ctl As Control
  
  On Error Resume Next
  'このフォーム内のすべてのコントロールを検索
  For Each ctl In Me.Controls
    With ctl
      If .ControlType = acTextBox Then
        'コントロールの種類がテキストボックスなら値をNull(空)に設定
        .Value = Null
      End If
    End With
  Next ctl

End Sub
0
0
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?