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

Changing Font Color For Specific Lines 2

Status
Not open for further replies.

gabriellec

Programmer
Mar 20, 2001
19
US
I have a report made which is based on a query. The goal of the report is to show a simple "Yes" or "No" to show if a project was completed on time. Everything works well with the query and report functions.

I would like to make the report clearer. Can anyone tell me how to change the properties so that when the record shows "No" the report shows that whole entry as different colored text?

Thanks
 
Hi Gabrielle C,
It's a little work but not too hard:
Place your report in design view and double-click on the "detail" bar to pop up its properties. Select the event tab then find "On Format". In its "field" choose "event procedure" then click on the ellipse "..." button just to the right. This will open up the visual basic module for this report and label a "sub" for you for this event.
You'll want to enter something like this between the title and "end sub" lines:

If Me![NameOfFieldThatSaysNo] = "No" Then
Me![NameOfAfieldYouWantToChangeColor].ForeColor = vbRed
Else
Me![NameOfAfieldYouWantToChangeColor].ForeColor = vbBlack
End If

You can add in as many other fields as you wish and if you want you can call the colors by number too. Oh, and if your field that says "no" is actually a check box then you have to have = False.

That's about it. Close and save and see if it flys! Enjoy,


Gord
ghubbell@total.net
 
ghubbell you are great!. With a bit of tweaking it worked!

Thanks ::)

Gabrielle
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top