Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

More than 3 Conditional Formats (Access 2007)

Status
Not open for further replies.

OneEyedBartender

Programmer
Apr 21, 2011
1
US
Hello!

I need help creating multiple conditional formats in Access. I found this great thread on this forum: but the code posted by ZmrAbdulla only works for the Font color, not the background fill color.

I've tried using "BackColor" but for whatever reason it won't work. As you can see below, I want to background/interior filled with the same color as the font.

Here is the code that I tried:

Code:
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)

Select Case Me.[Status].Value
    
Case Is = "Highest Priority"
    Me.[Status].ForeColor = vbRed
    Me.[Status].BackColor = vbRed
             
Case Is = "On Track"
    Me.[Status].ForeColor = vbGreen
    Me.[Status].BackColor = vbGreen

Case Is = "Need Attention"
    Me.[Status].ForeColor = vbYellow
    Me.[Status].BackColor = vbYellow
        
Case Else
     Me.[Status].ForeColor = vbBlack
     Me.[Status].BackColor = vbBlack
        
    End Select
End Sub

Thanks in advance for your help!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top