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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top