ProgramError
Programmer
Hi all,
I need a little help filling in the space of the code below. the code works if the sub is in the forms module using me.form in the line For Each ctrl In me.form But I would like to make this generic to all forms and I cant seem to find the right syntax. Can anyone help?
Ian Mayor (UK)
Program Error
Always make your words sweet and nice. Because you never know when you may have to eat them.
I need a little help filling in the space of the code below. the code works if the sub is in the forms module using me.form in the line For Each ctrl In me.form But I would like to make this generic to all forms and I cant seem to find the right syntax. Can anyone help?
Code:
' reset all background colours to standard
ChangeCTRLSToWhiteBG (????)
Code:
Public Sub ChangeCTRLSToWhiteBG(FormName As ????)
Dim ctrl As Control
For Each ctrl In ?????
If ctrl.ControlType = acTextBox Or ctrl.ControlType = acComboBox Then
ctrl.BackColor = AcWhite
End If
Next
End Sub
Ian Mayor (UK)
Program Error
Always make your words sweet and nice. Because you never know when you may have to eat them.