Alternating record Colours

andyh

Registered User.
Local time
Today, 20:08
Joined
Jul 11, 2000
Messages
32
Is it possible to have a report which shows alternating colours (grey, then white, then grey....)???

Thanks alot
 
First, set all of the controls to transparent in the detail section. Then set the detail background to light gray.

In the OnFormat property of the report, enter the following

Option Explicit
Dim fGray As Boolean
____________________________________________
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
Call AlternateGray
End Sub
____________________________________________

Private Sub AlternateGray()

Const adhcColorGray = &HC0C0C0
Const adhcColorWhite = &HFFFFFF
Me.Section(0).BackColor = IIf(fGray, adhcColorGray, adhcColorWhite)

fGray = Not fGray
End Sub
 
Thanks for that DR, that works perfectly
 
Huh... I can't get it to work. I keep getting a dialog box saying

The expression OnFormat you entered as the event property setting produced the following error: Invalid character.

* The expression may not result in the name of a macro, the name of a user-defined function, or [Event Procedure].

* There may have been an error evaluating the function, event, or macro.


Of course, I couldn't find any OnFormat property for the report itself, but entered the code snippet through the OnFormat property of the Detail section. Any ideas as to what I should try here?

Thanks,
Andreas

[This message has been edited by AUdby (edited 07-26-2000).]
 

Users who are viewing this thread

Back
Top Bottom