Alternating Colors

Norstar2

Registered User.
Local time
Today, 06:43
Joined
Mar 31, 2006
Messages
43
I am trying to create a report and alternate background colors for each entry of the report. For example, on a list of 10 items. Have the first row white, the 2nd row gray, the 3rd row white, etc.

Is there anyway to do this?
 
I use the following to give alternating backcolors in the Detail section of a Report. Placed in the Detail/OnPrint section of many of my reports;

Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)
If Detail.BackColor = 16777215 Then
Detail.BackColor = 15263976
Else
Detail.BackColor = 16777215
End If
End Sub


You should end up with white & light grey alternating. If you don't like the colours you can fiddle with the numbers eg 14811135 will give you a lightish yellow & 15263976 is light grey,which you have above. Have fun.
 
Last edited:
That is exactly what I needed! Thank you AN60!
 

Users who are viewing this thread

Back
Top Bottom