I have a procedure in my individual form modules that enumerates through the Controls collection to set a default value to all the combobox controls. I tried putting this procedure in a standard module and calling it from the form module. However, when I try to run it from the standard module I get an error that says I need to Declare a variable for Controls. It runs fine from the form module. What declaration should I use for Controls in a standard module? Thanks
Public Sub NullValues()
'Assigns a default value to each combo box control
Dim ctl As Control
For Each ctl In Controls
If TypeOf ctl Is ComboBox Then
ctl.DefaultValue = """No"""
End If
Next ctl
End Sub
Public Sub NullValues()
'Assigns a default value to each combo box control
Dim ctl As Control
For Each ctl In Controls
If TypeOf ctl Is ComboBox Then
ctl.DefaultValue = """No"""
End If
Next ctl
End Sub