restart page number counting on group (2007)

When I do a preview of a report that contains different records; I want that the page number counting restart when the the pageheader is an other record.
Now the page numbers goes from 1 to ..... wihtout restart counting page numbers.
Does some has done this before?

Re: restart page number counting on group (2007)

The instructions below are for Access 2003 and earlier versions, it will no doubt be slightly different for Access 2007.

Do you really want to restart page numbering at 1 for each record? If so:

- Open the report in design view.
- Click on the gray bar at the top of the Detail section.
- Activate the Properties window.
- Activate the Format tab.
- Make sure that the Force New Page property is set to Before Section.
- Activate the Event tab.
- Create an event procedure for the On Format event:

- The name of the Detail section might be different.
If you group the report on some field and want to restart numbering at 1 for each group, do the same as above for the group header section instead of for the detail section.

Re: restart page number counting on group (2007)

Re: restart page number counting on group (2007)

This works great! However, I also would like to have a total number of pages for the group, to show page x of y for each group, with y being the total number of pages in the group.
Is there a way to do so?
Thanks,

Re: restart page number counting on group (2007)

The attached database shows a different approach based on Reports: Printing First and Last Page Numbers for Report Groups on the Access Web.
It uses two arrays that are private to the report instead of a table, so you can use the code in multiple reports (you'll have to adjust the field name in the code, strCategoryName in the example).