J
Joe Williams
I am trying to set up code that will change the properties of each form's
control when the form is loaded. I want this behavior to happen for every
form in my application, so I thhought I would be smart and make the code a
public function and put it in a module. That way each form only needs to
call the publiic function.
However, when I run the code I get an "'invalid us of me" error. I am
assuming it is becuase Access cannot reconcile the me reference at the
module level. how can I make the following code work so that I only have to
have one master function which will then look up the form name when it is
running and set the properties accordingly ? (versus using me.controls)....
Thanks
For Each ctrl In Me.Controls ' Loop through the controls on the form
If ctrl.Properties("Name") Like "lbl*" Then
ctrl.Properties("ForeColor") = LabelColor ' Set a Property value for the
control
Else
End If
Joe
control when the form is loaded. I want this behavior to happen for every
form in my application, so I thhought I would be smart and make the code a
public function and put it in a module. That way each form only needs to
call the publiic function.
However, when I run the code I get an "'invalid us of me" error. I am
assuming it is becuase Access cannot reconcile the me reference at the
module level. how can I make the following code work so that I only have to
have one master function which will then look up the form name when it is
running and set the properties accordingly ? (versus using me.controls)....
Thanks
For Each ctrl In Me.Controls ' Loop through the controls on the form
If ctrl.Properties("Name") Like "lbl*" Then
ctrl.Properties("ForeColor") = LabelColor ' Set a Property value for the
control
Else
End If
Joe