4

I inherited a MS Access database and at my new job. I don't know much about Access and they asked if I could make every other line of a report a different color so it is easier to read. Is there an easy way to do this?

Linger
  • 14,942
  • 23
  • 52
  • 79
Dan Thomas
  • 285
  • 1
  • 2
  • 16

1 Answers1

4

This is pretty easy to do. The easiest way I found to do this is to use the following code:

Option Explicit
Dim ColorDetail As Boolean

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
   If ColorDetail Then
      Detail.BackColor = 16777215
   Else
      Detail.BackColor = 13290186
   End If
   ColorDetail = Not (ColorDetail)
End Sub
Linger
  • 14,942
  • 23
  • 52
  • 79