I have created a report with 2 grouping levels - FSID & Department. I labored long & hard to find code so that the page header and footer would not display on the initial page of each FSID grouping. My code nearly works...except on page 2. Below is my code:
Here's what has me puzzled. I have identical code for the Page Header - and it works. In addition, when I put in a break point and debug the code line by line, vb is identifying grpArrayPage(me.page) = 2 and performing the else code...except that the footer is not visible on page 2.
Any ideas on what may cause this to occur are welcome. Also, if perhaps there is a better way to assign group numbers to pages, I can try another method and perhaps that would get the footer to show.
Thanks in advance for the help!
Code:
Private Sub PageFooterSection_Format(Cancel As Integer, FormatCount As Integer)
Dim i As Integer
If Me.Pages = 0 Then
ReDim Preserve grpArrayPage(Me.Page + 1)
ReDim Preserve grpArrayPages(Me.Page + 1)
GrpNameCurrent = Me.FSID
If GrpNameCurrent = GrpNamePrevious Then
grpArrayPage(Me.Page) = grpArrayPage(Me.Page - 1) + 1
intGrpPages = grpArrayPage(Me.Page)
For i = Me.Page - ((intGrpPages) - 1) To Me.Page
grpArrayPages(i) = intGrpPages
Next i
Else
intGrpPage = 1
grpArrayPage(Me.Page) = intGrpPage
grpArrayPages(Me.Page) = intGrpPage
End If
Else
Me.txtGrpPages = "Group Page " & grpArrayPage(Me.Page)
End If
Me.txtGrpPages = "Group Page " & grpArrayPage(Me.Page) & ""
'of " & grpArrayPages(Me.Page)
GrpNamePrevious = GrpNameCurrent
'now code to determine whether or not the footer should be visible
If grpArrayPage(Me.Page) = 1 Then
Me.PageFooterSection.Visible = False
Else
Me.PageFooterSection.Visible = True
End If
End Sub
Here's what has me puzzled. I have identical code for the Page Header - and it works. In addition, when I put in a break point and debug the code line by line, vb is identifying grpArrayPage(me.page) = 2 and performing the else code...except that the footer is not visible on page 2.
Any ideas on what may cause this to occur are welcome. Also, if perhaps there is a better way to assign group numbers to pages, I can try another method and perhaps that would get the footer to show.
Thanks in advance for the help!