Clear all Controls in a Form
Clear all Controls in a Form
Rate Clear all Controls in a Form
(2(2 Vote))
Sub ClearControls(frmName As Form)
Dim objObject As Object
Dim I As Long
For I = 0 To frmName.Count - 1
Set objObject = frmName.Controls(I)
If TypeOf objObject Is TextBox Then
objObject.Text = ""
ElseIf TypeOf objObject Is CheckBox Then
objObject.Value = False
' ElseIf TypeOf objObject Is ......... Then
' objObject.Property = Value
End If
Next I
End Sub
Clear all Controls in a Form Comments
No comments yet — be the first to post one!
Post a Comment