Page Numbers In Reports by Section

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a report that is grouped by customers and would like individual page
numbers for each customer in the report (ex. 1 of 2) instead of 1 of 800
(length of entire report). I found an article on knowledgebase as well as
one on the Access Web but am having trouble using code from either database.
Anyone have any other ideas on how to do this?
 
If you running the print report using code, instead of printing all the
groups in one go, open a recordset containng all the groups, and create a
loop to print the report every time with a different group

If you need help writing the code, we here
 
Doesn't work in this particular case. I have about 100 customers reporting
to one sales rep. I want the report to contain all the pages for each sales
rep so they can just print out the pages for all their customers from one
report. If I split it up, I will have to e-mail 100 separate attachments for
each different sales rep.
 
I have a report that is grouped by customers and would like individual page
numbers for each customer in the report (ex. 1 of 2) instead of 1 of 800
(length of entire report). I found an article on knowledgebase as well as
one on the Access Web but am having trouble using code from either database.
Anyone have any other ideas on how to do this?

The code found at

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

works quite well. If you are using it and it isn't working, check
these for these things....

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]
 
So you can write some code to do that
Try it mybe it will help


Declare for the report to variables
Dim reportPageNum as integer, customersNum as String ' write the right type

On the group header section on the on print event write
If nz(customersNum ,"") <> me.customers Then
reportPageNum = 1
customersNum = me.customers
Else
reportPageNum = reportPageNum +1
End If

On the page footer create a field, unbound, write on the on print section
me.PageNumberField = reportPageNum

I hope it help
 
Sorry that should be on the page header

If nz(customersNum ,"") <> me.customers Then
reportPageNum = 1
customersNum = me.customers
Else
reportPageNum = reportPageNum +1
End If
 
Thanks to all for your help! I got it working!

fredg said:
I have a report that is grouped by customers and would like individual page
numbers for each customer in the report (ex. 1 of 2) instead of 1 of 800
(length of entire report). I found an article on knowledgebase as well as
one on the Access Web but am having trouble using code from either database.
Anyone have any other ideas on how to do this?

The code found at

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

works quite well. If you are using it and it isn't working, check
these for these things....

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]
 
I have done all this but it is not working. I get no error messages and no
page numbers by section. The report is nearly 500 pages long with 88
sections. Any suggestions welcome. Thanks

fredg said:
I have a report that is grouped by customers and would like individual page
numbers for each customer in the report (ex. 1 of 2) instead of 1 of 800
(length of entire report). I found an article on knowledgebase as well as
one on the Access Web but am having trouble using code from either database.
Anyone have any other ideas on how to do this?

The code found at

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

works quite well. If you are using it and it isn't working, check
these for these things....

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]
 
Back
Top