Hi everyone,
I'm trying to change the forecolor of a textbox based on the value of another textbox. How can I get the condition to apply to each record and not just the first record? For instance in my code below, if my first record happens to be true, then all the resulting records for Text2 will be red(255) (which is something that I don't want to happen). I'd like the condition to apply to each record. What am I missing? (Please excuse the naming conventions....still new to coding.)
Private Sub Form_Load()
Forms!Form1!Text1.SetFocus
If Me!Text1 = "Alert" Then
Forms!Form1!Text2.SetFocus
Me!Text2.ForeColor = 255
End If
End Sub
I'm trying to change the forecolor of a textbox based on the value of another textbox. How can I get the condition to apply to each record and not just the first record? For instance in my code below, if my first record happens to be true, then all the resulting records for Text2 will be red(255) (which is something that I don't want to happen). I'd like the condition to apply to each record. What am I missing? (Please excuse the naming conventions....still new to coding.)
Private Sub Form_Load()
Forms!Form1!Text1.SetFocus
If Me!Text1 = "Alert" Then
Forms!Form1!Text2.SetFocus
Me!Text2.ForeColor = 255
End If
End Sub