A
Antonio
I have a form that displays in datasheet format. It
contains several fields, two of which are
called "SenderID" and "DateSent". I would like to change
the back color of both fields depending on what
the "SenderID" filed is currently displaying. I tried the
following if statement on the forms "On Current" event:
Private Sub Form_Current()
If Me.SenderID = "Admitted" Then
Me.SenderID.BackColor = vbRed
Me.DateSent.BackColor = vbRed
Else
Me.SenderID.BackColor = vbWhite
Me.DateSent.BackColor = vbWhite
End If
End Sub
However, when I save, compile, and open the form....the
back color both of the entire columns is Red vice just
the records whose SenderID field is "Admitted". I dont
know what I am doing wrong.
contains several fields, two of which are
called "SenderID" and "DateSent". I would like to change
the back color of both fields depending on what
the "SenderID" filed is currently displaying. I tried the
following if statement on the forms "On Current" event:
Private Sub Form_Current()
If Me.SenderID = "Admitted" Then
Me.SenderID.BackColor = vbRed
Me.DateSent.BackColor = vbRed
Else
Me.SenderID.BackColor = vbWhite
Me.DateSent.BackColor = vbWhite
End If
End Sub
However, when I save, compile, and open the form....the
back color both of the entire columns is Red vice just
the records whose SenderID field is "Admitted". I dont
know what I am doing wrong.