ACC1x: Consecutively Numbering Pages for Two or More ReportsID: Q100919
|
This article describes how to consecutively number the pages of multiple reports. For example, if the first report has 10 pages, then the second report will begin numbering at page 11.
This article assumes that you are familiar with Access Basic and with
creating Microsoft Access applications using the programming tools provided
with Microsoft Access. For more information on Access Basic, please refer
to the "Introduction to Programming" manual.
The following steps demonstrate how to consecutively number the pages of
multiple reports:
'******************************************************
'Declarations Section of Module
'******************************************************
Option Explicit
Global CurrPage As Integer
'======================================================
'This function returns the page number to be used in the
'consecutive report footer(s). It also increments the Global
'Variable CurrPage.
'======================================================
Function GetPage ()
CurrPage = CurrPage + 1
GetPage = CurrPage
End Function
'======================================================
'This function is called by the first report to initialize the
'Global variable to 0.
'======================================================
Function InitPage ()
CurrPage = 0
End Function
'======================================================
'This function is called from the first report's page footer.
'======================================================
Function SetPage (PgNumber As Integer)
CurrPage = PgNumber
End Function
Microsoft Access "User's Guide," version 1.0, pages 422-424 and 440-444
Microsoft Access "Language Reference," version 1.0, page 364
Additional query words: reports
Keywords : kbusage RptOthr
Version : 1.0 1.1
Platform : WINDOWS
Issue type : kbinfo
Last Reviewed: March 24, 1999