Alternate Row Shading!!! (1 Viewer)

Waldin

Registered User.
Local time
Today, 07:47
Joined
Oct 11, 2012
Messages
109
hi all after including the BELOW code in my OnFormat Event in the detail bar this is what my report looks like (see attached image).

my back colour is set to white.

Const shadedColor = 16777215
' Const shadedColor = 12632256 ' alternative shade colors
' Const shadedColor = 12632256
' Const shadedColor = 12632256
' Const shadedColor = 12632256
Const normalColor = 12632256

' Choose a color based on the shadeNextRow value
If shadeNextRow = True Then
Me.Section(acDetail).BackColor = shadedColor
Else
Me.Section(acDetail).BackColor = normalColor
End If

' Switch the color for the next row
shadeNextRow = Not shadeNextRow

Detail_Format_Exit:
Exit Sub

Detail_Format_Error:
MsgBox "Error " & Err.Number & ": " & Err.Description
Resume Detail_Format_Exit
 

Attachments

  • To Do.zip
    172.9 KB · Views: 145

John Big Booty

AWF VIP
Local time
Today, 14:47
Joined
Aug 29, 2005
Messages
8,263
If you are using Access '07 (and beyond I assume) you shouldn't need to use code alternate colouring is a native feature, have a look at the format tab for the Details section of your report.


 

Attachments

  • Capture.JPG
    Capture.JPG
    59.2 KB · Views: 250

Waldin

Registered User.
Local time
Today, 07:47
Joined
Oct 11, 2012
Messages
109
thanks, i was complicating things.:eek:
 

Users who are viewing this thread

Top Bottom