Changing Font Colors Using a Criteria in a Report

  • Thread starter Thread starter Scott and Penny Heeren
  • Start date Start date
S

Scott and Penny Heeren

I need help with the language and criteria in a report to have certain
records font show in a different color. For example I am managing an Army
National Guard unit it Iowa that has 140 soldiers. 68 of which are on a
deployment in Iraq. 40 are elsewhere, and the rest are drilling. I have a
Yes/No box that is checked if they are deployed, and another Yes/No box if
they are Home Station. My question is in a report how do I show them in a
different color? IE Red for Deployed, Blue for Homestation, Green for
other. What would the language look like? I am a simpleton when it comes
to VBA.

PLEASE HELP!

SFC H
 
Scott and Penny,
Use the OnFormat event of the report section that contains the Yes/No
fields...
I'll use If statements, but CaseSelect would do the job too. (use your
own field names)
If Deployed = True Then
SoldierName.ForeColor = QBColor(4) 'red
ElseIf HomeStation = True Then
SoldierName.FoeColor = QBColor(1) 'blue
Else
SoldierName.ForeColor = QBColor(0) 'black
End If

Use the RGB function, instead of QBColor, if you want to tweak the colors
a bit...

I didn't have time to test, but that should do it.
And... thank you for your service to our country.
 
Back
Top