G
Guest
I have a Report that I use for a Catalog system
I've added a Color Tab that will change for each Different PageHeader
However, I can only use 2 colors and switch back and forth.
How can I use a standard Pallet of colors, that I choose, and have it loop
through those colors for each change?
Option Compare Database
Option Explicit
Dim getname
Private shadeNextRow As Boolean
Const shadedColor = 14078404
Const normalColor = 14281974
Private Sub PageHeaderSection_Format(Cancel As Integer, FormatCount As
Integer)
On Error GoTo PageHeader_Format_Error
If Me.Table_of_Contents = getname Then
Else
' Choose a color based on the shadeNextRow value
If shadeNextRow = True Then
Me.Box76.BackColor = shadedColor
Else
Me.Box76.BackColor = normalColor
End If
' Switch the color for the next row
shadeNextRow = Not shadeNextRow
End If
getname = Me.Table_of_Contents
PageHeader_Format_Exit:
Exit Sub
PageHeader_Format_Error:
MsgBox "Error " & Err.Number & ": " & Err.Description
Resume Detail_Format_Exit
End Sub
I've added a Color Tab that will change for each Different PageHeader
However, I can only use 2 colors and switch back and forth.
How can I use a standard Pallet of colors, that I choose, and have it loop
through those colors for each change?
Option Compare Database
Option Explicit
Dim getname
Private shadeNextRow As Boolean
Const shadedColor = 14078404
Const normalColor = 14281974
Private Sub PageHeaderSection_Format(Cancel As Integer, FormatCount As
Integer)
On Error GoTo PageHeader_Format_Error
If Me.Table_of_Contents = getname Then
Else
' Choose a color based on the shadeNextRow value
If shadeNextRow = True Then
Me.Box76.BackColor = shadedColor
Else
Me.Box76.BackColor = normalColor
End If
' Switch the color for the next row
shadeNextRow = Not shadeNextRow
End If
getname = Me.Table_of_Contents
PageHeader_Format_Exit:
Exit Sub
PageHeader_Format_Error:
MsgBox "Error " & Err.Number & ": " & Err.Description
Resume Detail_Format_Exit
End Sub