Conditional formating (1 Viewer)

Mikey

New member
Local time
Today, 19:00
Joined
Jan 30, 2000
Messages
5
I am trying to change the color of a line in a report if one of the fields contain a certain value.
 
P

Phillip

Guest
You could add a line of code to the OnFormat event of the detail section. For example:

Me!SpecificLine.BorderColor = Iif(Me!SpecificField = CertainValue, SpecialColor, RegularColor)

You could use a variety of objects and their properties to achieve the effect you're attempting. I made a report myself that shades every other line. It is very practical being that the report is landscape/legal and is rarely faxed or copied. I used an invisible text box to keep a running sum of the record numbers. Then I placed a shaded rectangle behind all of the fields in the detail section. Using the OnFormat event, I have my code test whether the record number is odd or even and adjust the visible property of the rectangle accordingly. The result is a report with every other record shaded all the way across (much easier for the eyes to follow).
 

Users who are viewing this thread

Top Bottom