Question : Shading alternating rows in reports

Hi Experts. I once needed to shade alternating rows in a report, so I found this article on Microsoft's site:
http://office.microsoft.com/en-us/access/HA012191461033.aspx which was really great to get my rows change colors in Detail portion of the report. How would I change this script to change shading in footer only? Here's now my report layout looks:

Report Header
-----------------------------------------------------------
THIS IS REPORT HEADER TEXT
-----------------------------------------------------------
Page Header
-----------------------------------------------------------
Column1    Column2    Column3
-----------------------------------------------------------
GroupHeader0
----------------------------------------------------------- nothing in GroupHeader0
Detail
----------------------------------------------------------- nothing in Detail portion of the report either
GroupFooter1
-----------------------------------------------------------
SumColumn2    SumColumn3
-----------------------------------------------------------
Page Footer
----------------------------------------------------------- nothing in page footer
Report Footer
----------------------------------------------------------- I have date in report footer


So, In this case my report only shows sums per Grouped Header. The summed amounts are shown in the footer. That the part that I want to change colors, but i can't get it to work. I know i need to put some code into

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

End Sub

But no matter what I try, nothing works at this time. Please help!!!

Thanks

Answer : Shading alternating rows in reports

I use the following to color alternate rows: Change txtField to the names of your controls/labels and place this in the Footer_Format Event

        ' Need to create a control name LineNum with it's source =-1, Running Sum - Overall. (This is a Hidden Textbox)
    Const White = 16777215
    Const Gray = 15066597
   
    If (Me![LineNum] Mod 2) = 0 Then
        txtField1.BackColor = Gray
        txtField2.BackColor = Gray
        txtField3.BackColor = Gray
    Else
        txtField1.BackColor = White
        txtField2.BackColor = White
        txtField3.BackColor = White
    End If

Random Solutions  
 
programming4us programming4us