Afraid I can't comment on why it's not working for you. I can only say
that
I've used that code successfully on many occasions. I don't see any
obvious
error.
--
Doug Steele, Microsoft Access MVP
(no private e-mails, please)
Doug,
The code on this website doesn't work. Can you tell me what I'm doing
wrong. I have a report that has one grouping by Compnay Name.
The first company is one page which shows 1 of 1. The 2nd company has
2
pages and it shows 1 of 1 on the first page and 2 of 2 on the second
page.
I
don't know what I'm doing wrong. I've used the same code as below:
Option Compare Database
Option Explicit
Dim GrpArrayPage(), GrpArrayPages()
Dim GrpNameCurrent As Variant, GrpNamePrevious As Variant
Dim GrpPage As Integer, GrpPages As Integer
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![Company Name]
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
Any ideas?
Thank you,
Sarah
:
Check
http://www.mvps.org/access/reports/rpt0013.htm at "The Access
Web"
--
Doug Steele, Microsoft Access MVP
(no private e-mails, please)
I have a monthly productivity report that I print for a list of staff
members
and the report content is fine. However, some employees have
multiple
pages
and I have to indicate page numberings at the footer (i.e., Page 1
of
7,
etc...). The problem is that Access will indicate the total number
of
pages
for all employees, so instead of John Doe's report showing 'Page 1
of
7'
it
shows 'Page 1 of 357'.
Does anyone know a way so to have this report display the 'Page 1 of
7'
format?
Thanks in advance!