|
Public Sub ClearAllControls(frmForm As Form)
Dim ctlControl As Object ' Initialize all controls that can be initialized ' Any control with a text property or a list-index property On Error Resume Next For Each ctlControl In frmForm.Controls ctlControl.Text = "" ctlControl.ListIndex = -1 DoEvents Next ctlControl End Sub 'Just call this procedure from your code like this: Call ClearAllControls(Me) |