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

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