Home  Fees/Services  Access Examples  Tutorials  Access Download  Articles  Search  Forums  Blockchain Tech  Contact  Privacy  Links
Access Report Examples

Access Report Design Tutorials

Report Line Counter
Change Line Color
Report Running Sum
Report Page Subtotals
Graphics Overlay
Dynamic Crosstab
Report Mail Merge

Alternating Line Color Access Reports

Change Background Color of Report Lines

Do you remember the good old days when you got fan-fold computer printouts that had alternating color lines?  These banded report lines made it easier for your eyes to follow across wide detail lines. Here's a way for you to reproduce this alternating line color effect without having to buy the old fan-fold paper and you can choose any color - pastels only please.

Our programming team has 15 members containing a wide variety of technical database knowledge and programming experience. Experts in small business management and scientific database programming.

Do you and your clients need access to data on the Internet? We can create a secure system to match your requirements perfectly.

Follow these steps: Create an 'On Print' event procedure in the Detail section of your report by clicking on the 'Detail' grey bar and viewing the properties sheet. In the VB code create a global variable just under the 'Option Compare Database' line.

In this example we use 'Dim gbl_shade As Boolean'. Create the event procedure code as show below.  This code will interrogate the gbl_shade variable and when it is True the report line background color gets changed (in this case the highlight color will be yellow-gold).  After the if statement the code switches the gbl_shade variable to the opposite boolean value.

Shading alternating rows in reports

Newly figured out simple method without all the complexity of the above alternating line color code:

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
If Me.Detail.BackColor = 16777215 Then
    Me.Detail.BackColor = 12582910
    Me.Detail.BackColor = 16777215
End If
End Sub

Now, isn't the above code much simpler?

A Blue Claw Database Design Article:

ODBC Links To Other DB Systems

Contact Information

Microsoft Access 2013 2010 All Windows Versions

Copyright 2000-2018 Blue Claw Database Design