Question : Overriding the max 3 Conditional Formating in Access

I am looking for a way to override the maximum 3 conditional formating in Access.  I have spent about an hour searching but have had no luck for my needs.

Here is what I have.
I have a single form and want to apply conditional formatting to a combo box which has six values.  I would like the background of the box (Animal Care) to change according to the values chosen (Green, Yellow, Orange, Red, Black, Grey).  Additionally for the box that changes to back I will need to change the text to white and for all of them for that matter.

This is a singe form in form view not continuous nor datasheet view.

I appreciate the time and help on the question.

Answer : Overriding the max 3 Conditional Formating in Access

I would try adding code like this to your form.  I used the colors as the values, but you can update accordingly
(and update the control name, of course!).

Private Sub Combo0_Change()
   
    With Me.Combo0
        Select Case .Value
            Case "Green": .BackColor = vbGreen: .ForeColor = vbBlack
            Case "Yellow": .BackColor = vbYellow: .ForeColor = vbBlack
            Case "Orange": .BackColor = 33023: .ForeColor = vbBlack
            Case "Red": .BackColor = vbRed: .ForeColor = vbBlack
            Case "Black": .BackColor = vbBlack: .ForeColor = vbWhite
            Case "Grey": .BackColor = 8421504: .ForeColor = vbBlack
            Case Else: .BackColor = vbWhite: .ForeColor = vbBlack
        End Select
    End With
   
End Sub
Random Solutions  
 
programming4us programming4us