Good thing is, you don't have to write several lines of source codes, the function below will do just that.
This visual basic function will clear texts any control with text property or a list-index property in the form.
Public Sub ClearAllControls(frmForm As Form)
Dim ctlControl As Object
On Error Resume Next
For Each ctlControl In frmForm.Controls
ctlControl.Text = ""
ctlControl.LISTINDEX = -1
DoEvents
Next ctlControl
End Sub
0 comments:
Post a Comment