Restarting pagenumbering for each customer

P

Petterq

I have an invoicing report that creates the basis for invoicing. To some
customers this report is one page only, and for others it might take several
pages.
In my report the pagenumbering is continuous throughout the report, thus 1
customer might have his report on page 15 of 38.
How cab i restart the pagenumbering for each customer.
The report is grouped on customer ID.
 
F

fredg

I have an invoicing report that creates the basis for invoicing. To some
customers this report is one page only, and for others it might take several
pages.
In my report the pagenumbering is continuous throughout the report, thus 1
customer might have his report on page 15 of 38.
How cab i restart the pagenumbering for each customer.
The report is grouped on customer ID.

See:
"Printing First and Last Page Numbers for Report Groups "
http://www.mvps.org/access/reports/rpt0013.htm

Things to make sure of:
1) Add a control to the page Footer that computes [Pages]
= [Pages]
You can make this control not visible if you wish.

2) Add an unbound control to the Page Footer.
Name this control "ctlGrpPages"

3) Paste the code into the Page Footer Format event.

4) In the code, change Me!Salesman to
Me![Name of the control used to group by]
 
P

Petterq

Hi.

I have tried to follow the instructions. When i run the report I get an
Compile error: Invalid inside procedure.

I pasted the code in, after the first line below, and the second line is
highlighted when the error message appears.

Private Sub PageFooterSection_Format(Cancel As Integer, FormatCount As
Integer)
Option Compare Database

Suggestions??

PetterQ

fredg said:
I have an invoicing report that creates the basis for invoicing. To some
customers this report is one page only, and for others it might take several
pages.
In my report the pagenumbering is continuous throughout the report, thus 1
customer might have his report on page 15 of 38.
How cab i restart the pagenumbering for each customer.
The report is grouped on customer ID.

See:
"Printing First and Last Page Numbers for Report Groups "
http://www.mvps.org/access/reports/rpt0013.htm

Things to make sure of:
1) Add a control to the page Footer that computes [Pages]
= [Pages]
You can make this control not visible if you wish.

2) Add an unbound control to the Page Footer.
Name this control "ctlGrpPages"

3) Paste the code into the Page Footer Format event.

4) In the code, change Me!Salesman to
Me![Name of the control used to group by]
 
F

fredg

Hi.

I have tried to follow the instructions. When i run the report I get an
Compile error: Invalid inside procedure.

I pasted the code in, after the first line below, and the second line is
highlighted when the error message appears.

Private Sub PageFooterSection_Format(Cancel As Integer, FormatCount As
Integer)
Option Compare Database

Suggestions??

PetterQ

fredg said:
I have an invoicing report that creates the basis for invoicing. To some
customers this report is one page only, and for others it might take several
pages.
In my report the pagenumbering is continuous throughout the report, thus 1
customer might have his report on page 15 of 38.
How cab i restart the pagenumbering for each customer.
The report is grouped on customer ID.

See:
"Printing First and Last Page Numbers for Report Groups "
http://www.mvps.org/access/reports/rpt0013.htm

Things to make sure of:
1) Add a control to the page Footer that computes [Pages]
= [Pages]
You can make this control not visible if you wish.

2) Add an unbound control to the Page Footer.
Name this control "ctlGrpPages"

3) Paste the code into the Page Footer Format event.

4) In the code, change Me!Salesman to
Me![Name of the control used to group by]

The "Option Compare Database" should appear only once, at the very top
of the code window (not within the procedure).
Look at that mvps page a second time.
The next 5 lines appear ABOVE the sub procedure

Option Compare Database
Option Explicit

Dim GrpArrayPage(), GrpArrayPages()
Dim GrpNameCurrent As Variant, GrpNamePrevious As Variant
Dim GrpPage As Integer, GrpPages As Integer
____________________________
Then comes the sub procedure.

Private Sub PageFooterSection_Format(Cancel As Integer, FormatCount
As Integer)
Dim i As Integer
If Me.Pages = 0 Then
ReDim Preserve GrpArrayPage(Me.Page + 1)

etc..........
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top