MS ACCESS: Report page numbers

1. Is there any built-in way (other than custom VB code) to set the starting page number for a report?
A client has three reports that she consecutively/contiguously spews out to a PDF file, and she ends up having to not use ACCESS page numbers and insert page numbers in Acrobat.

2. In this same 3-report document, the first report is a summary (table of contents as such) listing of the records, which lists the page number the detail records are displayed.  She does this manually in acrobat(!)
I assume there's no way other than a combination of pre-running the detail reports to UPDATE their own record to capture what page they ended up on, and then use that (new) field to print in the table of contents.
(It's actually a little more complicated, in that the detailed records can appear on multiple pages, thus I would guess a X-product (relational) side table is needed to record each page # listing in new records, and then have custom code to list (multiple) page numbers in the TOC)

thanks!
willsherwoodAsked:
Who is Participating?
 
answer_dudeConnect With a Mentor Commented:
Without code or something else to be the datasource (using another field to drive the page number), I'm not aware of any other way to reset the page number.

However, with VBA, using the code below pasted into your report module and then setting the Control Source property of your page number field to:

="Page " & ([Page]+GlobalPageNumber()) & " of  " & ([Pages]+GlobalPageNumber())

The user will be prompted for the starting page number when the report is run.  Optionally, you could drive that starting page number from another process, data value, or calculation.
Option Explicit
Dim globalPage As Integer

Function GlobalPageNumber()
    GlobalPageNumber = globalPage - 1
End Function

Private Sub Report_Open(Cancel As Integer)
    globalPage = InputBox("Starting Page Number: ", "Starting Page Number", 1)
End Sub

Open in new window

0
 
willsherwoodAuthor Commented:
super, many thanks!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.