Hello, I am tring to code my first generalized function, I have(which works as a function on a form)
Function ClearAll(c As String)
Dim ctl As Control
For Each ctl In Me.Controls
Select Case ctl.ControlType
Case acTextBox, acComboBox, acListBox, acCheckBox
If ctl.ControlSource = "" And ctl.Tag <> c Then
ctl.Value = Null
End If
Case Else
End Select
Next ctl
End If
Want to place in a module to create a general function so can use on all forms.
Have placed in a module, but not working, dose not like the
Me.Controls
which I can see that it would not as it is know in a module not on a spiecific form. Not sure how to take care of this. Any insight is appriciate
Function ClearAll(c As String)
Dim ctl As Control
For Each ctl In Me.Controls
Select Case ctl.ControlType
Case acTextBox, acComboBox, acListBox, acCheckBox
If ctl.ControlSource = "" And ctl.Tag <> c Then
ctl.Value = Null
End If
Case Else
End Select
Next ctl
End If
Want to place in a module to create a general function so can use on all forms.
Have placed in a module, but not working, dose not like the
Me.Controls
which I can see that it would not as it is know in a module not on a spiecific form. Not sure how to take care of this. Any insight is appriciate