Changing field colours based upon other fields

stuart_adair

Registered User.
Local time
Today, 08:56
Joined
Jan 13, 2009
Messages
57
Hello all,

I'll keep this one to the point...

3 fields on a form:
  • MD Door
  • Customer Door
  • Text 400 (Currently unbound)
I want to change the properties of the the Text 400 field so its green if MD Door and Customer Door match, and red if not.

Thanks as always.
Stu
 
Hello Stu, You might need to use the Form Current property to do this..
Code:
Private Sub Form_Current()
    If Me.[MD Door] = Me.[Customer Door] Then
         Me.[Text 400].BackColor = vbGreen
    Else
        Me.[Text 400].BackColor = vbRed
    End If
End Sub
 

Users who are viewing this thread

Back
Top Bottom