ACC: How to Reset the Page Number on Group Level in a ReportID: Q104760
|
Moderate: Requires basic macro, coding, and interoperability skills.
By using a macro, or some code and a report's section properties, you can
design a report that breaks the page for each new entry in a group and
resets the report's page number. For example, in Microsoft Access 7.0
and 97, the Employee Sales By Country report in the sample database
Northwind.mdb is designed with this feature. In Microsoft Access 1.x
and 2.0 you can redesign the Employee Sales By Country report in the
sample database NWIND.MDB to break the page and reset the page number to 1
for each new country.
NOTE: The method used to reset the page number for each new country depends on whether the page number is displayed in the page header or page footer. If you use the wrong method, the page number is not reset correctly.
Macro Name Action
--------------------
Pager SetValue
Macro Actions
----------------
SetValue
Item: Page
Expression: 1
Select the Country Header section, and then click the Build button
for the OnFormat property to examine the event procedure.
In Microsoft Access 1.x and 2.0:
Select the Country Header section, and then set the section's
OnFormat property to the Pager macro.
Macro Name Action
--------------------
Pager SetValue
Macro Actions
----------------
SetValue
Item: Page
Expression: 0
Select the Country Footer section, and then click the Build button
for the OnFormat property, choose Code Builder, and click OK. In the
code window type the following:
Page = 1
In Microsoft Access 1.x or 2.0:
Select the Country Footer section, and set the OnFormat property to
the Pager macro.
For more information about resetting page numbers for each group in a report, search the Help Index for "resetting page numbers in reports," or ask the Microsoft Access 97 Office Assistant.
Additional query words: Custom
Keywords : kbusage RptLayou
Version : 1.0 1.1 2.0 7.0 97
Platform : WINDOWS
Issue type : kbhowto
Last Reviewed: March 27, 1999