Help with where to put coding

Crackers

Registered User.
Local time
Tomorrow, 07:37
Joined
May 31, 2002
Messages
36
Yesterday I was advised by 'Smart' on placing a certain code, as follows:

In the after update trigger of the combo box you can do the following

If YourCombobox = "-" Then
yourtextfield.ForeColor = vbRed
Else: yourtextfield.ForeColor = 0

End If
__________________

Please forgive my ignorance but where do I put this code... on the line for 'after update' or in the code builder. If it is the latter, how do I begin the code because it has Private Sub and End Sub. I am obviously no expert but I'm just trying to plod along and learn as I go.
Your help is gratefully accepted.
 
between Private Sub and End Sub.
Code:
Private Sub cboName_AfterUpdate()

   If Me!YourCombobox = "-" Then
      Me!yourtextfield.ForeColor = vbRed
   Else
      Me!yourtextfield.ForeColor = 0
   End If

End Sub
 
Last edited:

Users who are viewing this thread

Back
Top Bottom