highandwild
Registered User.
- Local time
- Today, 13:51
- Joined
- Oct 30, 2009
- Messages
- 435
Hi All
I can set the various colors of an object in the detail section of a form using the paint event but I would like to set the foreground color based upon the value in the field referred to by the object or another fields value.
I thought that I could do it like this below but it does not work. I am sure that I am almost there. Thanks in anticipation.
Private Sub Detail_Paint()
Select Case Me.txtTown.Value
Case "Dorchester"
Me.Forename.ForeColor = 8179068
Case "Weymouth"
Me.Forename.ForeColor = 1030655
Case "Wimborne"
Me.Forename.ForeColor = 4349166
End Select
End Sub
I can set the various colors of an object in the detail section of a form using the paint event but I would like to set the foreground color based upon the value in the field referred to by the object or another fields value.
I thought that I could do it like this below but it does not work. I am sure that I am almost there. Thanks in anticipation.
Private Sub Detail_Paint()
Select Case Me.txtTown.Value
Case "Dorchester"
Me.Forename.ForeColor = 8179068
Case "Weymouth"
Me.Forename.ForeColor = 1030655
Case "Wimborne"
Me.Forename.ForeColor = 4349166
End Select
End Sub