Count Pages

bkessinger
StarLounger
Posts: 71
Joined: 27 Aug 2010, 09:13

Count Pages

Post by bkessinger »

Is there a way to sequentially number pages in a report? The report are boat dock permits and the client would like to have each permit sequentially numbered beginning with Number 1. TIA.

Bill Kessinger

User avatar
HansV
Administrator
Posts: 78235
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Count Pages

Post by HansV »

Will one report contain multiple permits, each of which have to start with page 1? If so, you need a group header. If the permit is a group, you can use its group header. If you don't have a grouping level yet, add one, using the field that uniquely identifies the permit, and specify that this group level has a header.
The group header can have Height = 0 if you don't want to display anything in it.

Create an On Format event procedure for the group header:

Code: Select all

Private Sub GroupHeader0_Format(Cancel As Integer, FormatCount As Integer)
    Me.Page = 1
End Sub
where GroupHeader0 is the name of the group header. This event procedure resets the report's page number to 1.
Best wishes,
Hans

bkessinger
StarLounger
Posts: 71
Joined: 27 Aug 2010, 09:13

Re: Count Pages

Post by bkessinger »

Each report will be a series of permits numbered 1 to n. The permit number will be the page number and needs to be displayed in the page header. Is this possible? TIA.

User avatar
HansV
Administrator
Posts: 78235
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Count Pages

Post by HansV »

That is easier: just place a text box with Control Source

=[Page]

in the page header. No code needed.
Best wishes,
Hans

bkessinger
StarLounger
Posts: 71
Joined: 27 Aug 2010, 09:13

Re: Count Pages

Post by bkessinger »

Thanks Hans. That was easy.