highlight red based on value

awake2424

Registered User.
Local time
Yesterday, 21:31
Joined
Oct 31, 2007
Messages
479
Code:
Private Sub Combo1309_AfterUpdate()
   If Me.Combo1309.Value = "Yes" Then
   Me.Text1307 = Environ("UserName")
   
   ElseIf Me.Combo1309.Value = "No" Then
   Me.Text1307 = Environ("UserName")
End If
End Sub

I am using the above code to capture the login information. Is it possible to add a second criteria to the Me.Combo1309.Value = "No" that also highlights the Textbox (Gender) Red? Ideally, the value in this textbox would be switched to the opposite, but this option might be more trouble then its worth. Thanks.
 
Code:
ElseIf Me.Combo1309.Value = "No" Then
   Me.Text1307 = Environ("UserName")
   me.text1307.backcolor=vbRed
 
Don't forget to also switch the colour back to whatever you had before on the Yes condition; just in case the user picked No by accident and then immediately changes their choice, or they are likely to change it to Yes while still viewing the record at some point.
 

Users who are viewing this thread

Back
Top Bottom