Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Alternate Gray Lines on Report

How To

Alternate Gray Lines on Report

by  Garridon  Posted    (Edited  )
You may want to make a report easier to read by having alternating gray lines. To do this, go to your report's properties and add an event procedure to your On Format of your detail section. The constant can be changed to whatever color you want (a quick way to get the number is to choose a background color in one of your forms, and then copy the number and paste it in code).

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)

Const vbLightGrey = 14540253

If Me.CurrentRecord Mod 2 = 0 Then

Me.Section(acDetail).BackColor = vbLightGrey

Else

Me.Section(acDetail).BackColor = vbWhite

End If

End Sub

Register to rate this FAQ  : BAD 1 2 3 4 5 6 7 8 9 10 GOOD
Please Note: 1 is Bad, 10 is Good :-)

Part and Inventory Search

Back
Top