Page Numbering!

J

JOM

my report for each record is 3 pages long, and i would like to print the last
page not to have the page number. Using the following code to reset the page
numbering for each record that is printed, how do I add the code that will
not print the page number on the last page

Private Sub PageFooter_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!NoticeID
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!PageNumber = "Group Page " & GrpArrayPage(Me.Page) & " of " &
GrpArrayPages(Me.Page)
End If
GrpNamePrevious = GrpNameCurrent
End Sub
 
T

The Merg

Since you are computing the total page numbers along with the current page,
perform a check before you insert the page number. If the current page
number is the same as the total page number, leave the Page Number field
blank.

E.g.
If Me.Pages = 0 Then
--- Your code---

Else
If GrpArrayPage(Me.Page) = GrpArrayPages(Me.Page) Then
Me!PageNumber = ""

Else
Me!PageNumber = "Group Page " & GrpArrayPage(Me.Page) & " of " &
_
GrpArrayPages(Me.Page)

End If
End If

HTH,
The Merg
 
J

JOM

Thanks alot Merg, That worked perfect

The Merg said:
Since you are computing the total page numbers along with the current page,
perform a check before you insert the page number. If the current page
number is the same as the total page number, leave the Page Number field
blank.

E.g.
If Me.Pages = 0 Then
--- Your code---

Else
If GrpArrayPage(Me.Page) = GrpArrayPages(Me.Page) Then
Me!PageNumber = ""

Else
Me!PageNumber = "Group Page " & GrpArrayPage(Me.Page) & " of " &
_
GrpArrayPages(Me.Page)

End If
End If

HTH,
The Merg
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top