Conditional Formatting more than 3 conditions

  • Thread starter Thread starter BDavis
  • Start date Start date
B

BDavis

I'm trying to conditionally format a feild in a report so
that if = 1 it's blue, 2 it's green, 4 it's red etc.

I can't use the conditional format wizard becasue I need
more than three conditions. How can I get around this?
 
BDavis said:
I'm trying to conditionally format a feild in a report so
that if = 1 it's blue, 2 it's green, 4 it's red etc.

I can't use the conditional format wizard becasue I need
more than three conditions. How can I get around this?

Do it in code in the section's Format event:

Select Case Me.thetextbox
Case 1
Me.thetextbox.ForeColor = vbBlue
Case 2
Me.thetextbox.ForeColor = vbGreen
. . .
Case Else
Me.thetextbox.ForeColor = RGB(255,192,192) 'Pink ;-)
End Select
 
Back
Top