You want 5 rows with a white background, and then 5 rows with a grey
background?
1. Add a text box to the report, and give it these properties:
Control Source =1
Running Sum Over All
Format General Number
Name txtCount
2. Set the On Format property of the Detail section to:
[Event Procedure]
3. Click the Build button (...) beside this property.
Between the Private Sub... and End Sub lines enter something like this:
Dim lngColor As Long
Const lngcNormal = &HFFFFFF
Const lngcHighlight = &HCCCCCC
Const lngcRowSwap As Long = 5
If (((Me.txtCount - 1&) \ lngcRowSwap) Mod 2 = 0 Then
lngColor = lngcNormal
Else
lngColor = lngcHighlight
End If
With Me.Section(acDetail)
If .BackColor <> lngColor Then
.BackColor = lngColor
End If
End With
You may also need to change the BackStyle property of the text boxes to
transparent.
Adjust the colors to what you need.
--
Allen Browne - Microsoft MVP. Perth, Western Australia
Reply to group, rather than allenbrowne at mvps dot org.
Ken Kazinski said:
How do you set the background color for each 5 rows of data in a group?
I think I might be able to use the on print event, but that did not seem
to
work correctly.
Thanks in advance.