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.
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 - 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!
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.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.