Changing Colors based on values

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Is it possible to change the font color of a text box on a report based on
the value with that text box? An alternative would be changing the color of
that line on the report based on a value.

Any help would be appreciated.
 
Kevin G said:
Is it possible to change the font color of a text box on a report based on
the value with that text box? An alternative would be changing the color of
that line on the report based on a value.


Couple of ways. If you only want up to three other colors
(pluse your normal color), then you can use Conditional
Formatting (Format menu).

The more general way is to use VBA code in the section's
Format event. Here's one example:

Select Case Me.thetextbox
Case 1
Me.thetextbox.BackColor = vbRed
Case 2
Me.thetextbox.BackColor = RGB(255,228,228) 'pink
. . .
Case Else
Me.thetextbox.BackColor = vbBlack
End Select
 
Back
Top