Hi everyone,
Sorry I have to bother you with this question, it is asked a lot of times, but can't find the right thread. Looking for an easy way to alternate colors in detail section of report.
pampers
This reply assumes you want alternating gray and white shading.
1. Make sure your Detail section is one line high (can be taller but won't look as good with too much gray).
2. Set the BackStyle property of every control in the Detail section to Transparent.
3. In the code behind the report, put this in the Declarations area...
Code:
Dim fShade as Boolean
4. Put the following code on the OnPrint event of the Detail section...
Code:
Const acbcColorGray = 14540253
If fShade then
Me.Detail.BackColor = acbcColorGray
Else
Me.Detail.BackColor = vbWhite
End If
'Alternate the value of fShade
fShade = Not fShade
5. If it matters whether the first row on the page is shaded, put the following on the OnPrint event of the report's page header...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.