I,
Using Acces97 i'm trying to reset the page number to 1 on a group break.
Here is my code:
Private Sub PageFooter_Format(Cancel As Integer, FormatCount As Integer)
Dim i As Integer
ReDim Preserve GrpArrayPage(Me.Page + 1)
ReDim Preserve GrpArrayPages(Me.Page + 1)
If Me.Pages = 0 Then
GrpNameCurrent = Me!Bénef
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
I have placed a control «ctlGrpPages» in the page footer.
I've created a text box with the following control source ="Page " & [Page] & " of " & [Pages] in the group footer.
I get Group page 1 of x to x of x for my first group, but my second group generates "Blanks" - «GROUP PAGE OF »
Could someone give me a hint on where is the error..
Thanks
Aietoe!
Using Acces97 i'm trying to reset the page number to 1 on a group break.
Here is my code:
Private Sub PageFooter_Format(Cancel As Integer, FormatCount As Integer)
Dim i As Integer
ReDim Preserve GrpArrayPage(Me.Page + 1)
ReDim Preserve GrpArrayPages(Me.Page + 1)
If Me.Pages = 0 Then
GrpNameCurrent = Me!Bénef
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
I have placed a control «ctlGrpPages» in the page footer.
I've created a text box with the following control source ="Page " & [Page] & " of " & [Pages] in the group footer.
I get Group page 1 of x to x of x for my first group, but my second group generates "Blanks" - «GROUP PAGE OF »
Could someone give me a hint on where is the error..
Thanks
Aietoe!