Create alternating row colors on a report

By default, Access formats each row of a report's detail section with the same background color. When printing a report, shading every other line of the detail section can make it much easier to read. Use the AlternateBackColor property to specify a color to be displayed or printed on every other line in the detail section when viewing or printing a report.

The following example illustrates how to display light gray bars on every other line of the report's detail section when it is printed.

Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer) 
 
    Me.Section("Detail").AlternateBackColor = RGB(240, 240, 240) 
     
End Sub

Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.