Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Resetting Page Number based on Group 1

Status
Not open for further replies.

pcdaveh

Technical User
Sep 26, 2000
213
US
Situation: One long report with multiple groups. Currently the page numbers go from 1-250 approximately. I want to start the numbering sequence over at the start of a new group within the whole. Just imagine having 50 customers. Your printing there invoices in one run. Some customers invoices are 1 page , two pages, 3 pages, etc... but your printing them all at once. I need the page numbers to say 1 of 3, 1 of 1, 3 of 5, resetting to 1 of N at the start of a new customer.

Thanks in advance!
 
Here ya go. Cut and pasted from Access help file.

Reset page numbers for each group in a report

Create a macro that resets page numbers

1 Create a macro that uses the SetValue action to change the Page property to 1.

How?

Decide if the page number will appear in the page header or footer, and then use the following values for the SetValue action arguments.

Location of page number SetValue arguments
Page header Item: [Page]Expression: 0
Page footer Item: [Page]Expression: 1
2 Save and close the macro.

Modify the report

1 Open the report in Design view.
2 Create a text box for the page number in the page header or footer if you haven't already done so.

How?

3 For the first-level group header and footer, set the following properties, depending on where the page number appears.

If the page number appears in the page header, set the following properties.

Section Property Setting Purpose
Group header ForceNewPage Before Section Starts each group on a new page.
Group footer OnFormat Name of macro you created in the first procedure Resets the page number to 1 for the new group.
If the page number appears in the page footer, set the following properties.

Section Property Setting Purpose
Group header OnFormat Name of macro you created in the first procedure Resets the page number to 1 for the new group.
Group footer ForceNewPage After Section Starts each group on a new page.
Note The Employee Sales by Country report in the Northwind sample database resets the page number for each country. To view this report, open the Northwind database in the Samples subfolder of your Office folder. In the Database window, click the Reports tab, click Employee Sales By Country, and then click Design. For information on opening Northwind, click .
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top