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

Changing Font Colors in a Report 2

Status
Not open for further replies.

clem

Technical User
Dec 5, 2000
38
0
0
US
I have a report that shows scores of maintenance audits on different looms in our plant. If the audit score is less than 85 I would like the score to print in red, otherwise print in blue. Please help this novice Access user figure this out.
 
Hello,

You must call the procedure (with the appropriate IF statements) in the FORMAT section of the code for the reports. That is the key, it MUST be in the format section.

It is as easy as : (writing off top of head please confirm code in book but method is correct)

If me >85 then
me.Color = 12324 (i dont remem if you say blue or use to num. the help file should say)

Jeremy
 
Jeremy - thanks! You said to check the book for further instructions - what book would be good for a beginner who wants to learn code for Access? One of my co-workers knew enough to figure out the code you listed and it worked!! I get so excited when I see the power of code!!! To see something work is so fulfilling!
 
In Access 97 ....

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
If Me![Score] < .85 Then
Me![Score].FontBold = True '<--- Bold
Me![Score].ForeColor = 255 '<--- Red

Else
Me![Score].FontBold = False ' <--- No Bold
Me![Score].ForeColor = 0 ' <--- Black
End If
End Sub

In Access 2000 I believe there is something called condiitional formating that you can set for the report without writing code.

Dave
gallagherd@earthlink.net
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top