JeremyJones
New member
- Local time
- Today, 00:05
- Joined
- Sep 28, 2005
- Messages
- 8
Ok, right now I have some code that is printing the "page of pages" for individual groups in my report. This code has worked in other reports, so I put it in this report. It is however, not doing it properly. It seems like it is predicting the size of the groups improperly due to a field that can grow, and grow quite a bit. What's happening is the field 'Me.Funct' when printed is different, however the code sees it the same as before, until a couple pages later.
The following code is in the PageFooter_Format event:
The following code is in the PageFooter_Format event:
Code:
Dim I As Integer
If Me.Pages = 0 Then
ReDim Preserve GrpArrayPage(Me.Page + 1)
ReDim Preserve GrpArrayPages(Me.Page + 1)
GrpNameCurrent = Me.Funct
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
lblFunctPage.Caption = "Page" & " " & GrpArrayPage(Me.Page) & " of " & GrpArrayPages(Me.Page)
End If
GrpNamePrevious = GrpNameCurrent