I'm still playing with this one, and I've got a problem with the first
page numbering of a group of pages. Unfortunately it always says Page 1
of 1 when there are multiple pages - the second and subsequent pages are
correct, i.e. page 2 of 2 etc.
Where is this going wrong, the code I now have is the following: PU_SEQ
is the grouping control in the header.
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!PU_SEQ
If GrpNameCurrent = GrpNamePrevious Then
GrpArrayPage(Me.Page) = GrpArrayPage(Me.Page - 1) + 1
GrpPages = GrpArrayPage(Me.Page)
For i = Me.Page - ((GrpPages) - 1) To Me.Page
GrpArrayPages(i) = GrpPages
Next i
Else
GrpPage = 1
GrpArrayPage(Me.Page) = GrpPage
GrpArrayPages(Me.Page) = GrpPage
End If
Me!ctlGrpPages = "Page " & GrpArrayPage(Me.Page) & " of " &
GrpArrayPages(Me.Page)
Else
End If
GrpNamePrevious = GrpNameCurrent
End Sub