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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Conditional Formatting Urgent HELP!!!!

Status
Not open for further replies.

bronen

Technical User
Jul 23, 2008
2
I have a text box on a report that pulls values from a table: Blue, Red, Green, Gold, Yellow, Purple, and White.

The report is supposed to have the background behind each word be that color. IF the data has the color Blue, then the background color behind that word should be Blue as well. I have the following code

if PreviousStatus = Blue Then
PreviousStatus.BackColor = 16711860

As an example for blue. I have also tried:

Select Case Me.PreviousStatus.Value
Case "Blue"
Me.PreviousStatus.BackColor = 16711680
Case "Green"
Me.PreviousStatus.BackColor = RGB(0, 255, 0)
Case "Red"
Me.PreviousStatus.BackColor = RGB(255, 0, 0)
Case Else
Me.PreviousStatus.BackColor = vbWhite
End Select

Why is it wrong? Why am I not getting color to show up?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top