Question Record Text Colour based on Combo Box

carter1367

New member
Local time
Today, 19:40
Joined
Nov 1, 2009
Messages
6
I have a Form in table view, and I want the record colours to be based on the combo box of that record. Is this possible??
 
Yes it is you can use Conditional formatting to do this.

Alternatively you could use something like the following in the form's On Current event and in the Combo's On Change event;
Code:
If Me.ComboName = 1 Then
     Me.ControlName.ForeColor = 33023
     Me.ControlName2.Forecolor = 33023
Else If Me.ComboName = 2 Then
     Me.ControlName.ForeColor = 225
     Me.ControlName2.Forecolor = 225
Else
     Me.ControlName.ForeColor = 0
     Me.ControlName2.Forecolor = 0
End IF
 
Thank you for your reply. My data on the form is is a datasheet format. Conditional formatting does work, but I have 11 conditions, so needs to be coded. The code you provided, unfortunately doesn't seem to work. I don't know if this is because it is in a datasheet view or what. Although it could be me, not to good at the programming side of this.
 
....... I don't know if this is because it is in a datasheet view or what.........

I think you'll find that that is the problem. Could you make your form a continuous form? This will however raise it's own set of idiosyncrasies (problems).
 

Users who are viewing this thread

Back
Top Bottom