Color coding in Reports

goyalpr

New member
Local time
Today, 21:52
Joined
Jul 9, 2003
Messages
8
I have a table say "Cars" having fields model, make, year, HP, etc. I am printing a very simple report using this table.

Would it be possible to color code/make bold the entire row in report whenever the "year" is 2000? If yes, then someone coule please tell me how.

Thanks in advance
Prashant
 
Hey Prashant - you can do all of that! Help will help you figure out the attribute names.

'test for age 22
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
If txtage.Text = 22 Then
txtfname.FontBold = True
txtlname.FontBold = True
txtage.FontBold = True
Else
txtfname.FontBold = False
txtlname.FontBold = False
txtage.FontBold = False
End If
End Sub

If you wanted to shade the lines that meet your criteria then instead of the FontBolds, use:
Detail.BackColor = "12632256" (that's a shade of grey)
Detail.BackColor = "16777215" (back to white)
(Make sure the fields have transparent backgrounds though or you may not see it).

Good luck!

-Sean
 
Thanks a lot, Sean!!!

It is working the way I wanted it to work.

:) Prashant
 

Users who are viewing this thread

Back
Top Bottom