thegameoflife
Programmer
I asked this last week some time and could never get it straight.
On my report in the page footer I have a txtbox named ctlGrpPages. All of the grouping for the report is done by MEMBER#. For some reason when I step through the code it skips over the
Here is all the code.....TIA
On my report in the page footer I have a txtbox named ctlGrpPages. All of the grouping for the report is done by MEMBER#. For some reason when I step through the code it skips over the
Code:
Me!ctlGrpPages = "Group Page " & GrpArrayPage(Me.Page) & " of " & GrpArrayPages(Me.Page)
Here is all the code.....TIA
Code:
Option Compare Database
Option Explicit
Private Sub PageFooterSection_Format(Cancel As Integer, FormatCount As Integer)
Dim GrpArrayPage(), GrpArrayPages()
Dim GrpNameCurrent As Variant, GrpNamePrevious As Variant
Dim GrpPage As Integer, GrpPages 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![MEMBER#]
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
Else
Me!ctlGrpPages = "Group Page " & GrpArrayPage(Me.Page) & " of " & GrpArrayPages(Me.Page)
End If
GrpNamePrevious = GrpNameCurrent
End Sub