Access 2007 - Report Shading

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • dowlingm815
    New Member
    • Feb 2010
    • 133

    #1

    Access 2007 - Report Shading

    Contained within a 2007 database, a report has VBA code for detailed line shading as shown below. However, when a macro executes open report command, the shading does not appear. But appears when printed.

    Any suggestions would be appreciated.

    Code:
    Option Compare Database
    Option Explicit
     
    Private shadeNextRow As Boolean
    Const shadedColor = 12632256
    ' Const shadedColor = 15726583 ' alternative shade colors
    ' Const shadedColor = 14078404
    ' Const shadedColor = 13356495
    ' Const shadedColor = 14281974
    Const normalColor = 16777215
     
    Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
     
      On Error GoTo Detail_Format_Error
     
    ' 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
  • dowlingm815
    New Member
    • Feb 2010
    • 133

    #2
    Got it, the macro needs to specific print preview.

    Comment

    Working...