sara said:
I tried this and didn't get the shading. Here's my code:
(I changed Me!Detail1 to Detail1 and tried Detail and
Detail0, and still don't get the shading. I don't know
what Me! means).
Dim blnShade As Boolean
Private Sub Detail0_Print(Cancel As Integer, PrintCount As
Integer)
Const intColorGray = 14540253
If blnShade Then
Detail0.BackColor = intColorGray
Else
Detail0.BackColor = vbWhite
End If
blnColorGray = Not blnColorGray
End Sub
I am using Access2000. I want to install on an Access97
database, if it will work.
Mia culpa. Premature typulation on my part.
Using a fairly default report "right out of the box" (ala Wizard), and
adding the enhancement, here's the corrected code example:
Dim blnShade As Boolean
Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)
Const lngGray = 14540253
If blnShade Then
Me.Detail.BackColor = lngGray
Else
Me.Detail.BackColor = vbWhite
End If
blnShade = Not blnShade
End Sub
The Access-generated Sub name you get when you attach code to the OnPrint
event for the Detail section is your clue. This does work on Access 2000.
I'm not sure about Access 97, but I suspect it will work there, too.