Alternate coloured lines (records) in reports

Robert C

Registered User.
Local time
Today, 03:23
Joined
Mar 27, 2000
Messages
88
I used the following code to enable alternate lines (ie alternate records) on my report to have a grey background. This worked fine in Access 2000 however, as I have recently upraded to XP it no longer works. Can someone please tell me the amendment I need to make.

Thanks very much

Here's the code

Option Compare Database
Option Explicit

Private mfGray As Boolean

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
Call AlternateGray
End Sub


Private Sub AlternateGray()

' If the current section is to be printed in gray,
' then set the BackColor property for the section.
' This works only because the controls on the section
' are all set to be transparent.
Me.Section(acDetail).BackColor = _
IIf(mfGray, vbMenuBar, vbWhite)

' Next time, do it the opposite of the way
' you did it this time.
mfGray = Not mfGray
End Sub
:D :)
 
I use the following which works fine in A97


Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)
Const Grey = 16777215
Const White = 12632256
Me.Detail.BackColor = IIf(Me.Detail.BackColor = White, Grey, White)
End Sub
 

Users who are viewing this thread

Back
Top Bottom