page numbering question

  • Thread starter Slez via AccessMonster.com
  • Start date
S

Slez via AccessMonster.com

I have a report that is an estimate of one project that may be sent to
multiple customers. For example:
The same estimate for Jones Elementary School Renovation is being sent to -
Company A, Company B, and Company C. For this example, let's assume that the
estimate for each company takes up 3 pages. I have my report set up that
after the appropriate section it forces a new page...works great!

I would like to have a page number show up on each sheet as "Page # of #",
I'd like the pages to read as follows:
1 of 3
2 of 3
3 of 3
1 of 3
2 of 3
3 of 3
1 of 3
2 of 3
3 of 3
...as apposed to: 1 of 9, 2 of 9, 3 of 9, 4 of 9, and so on.

Is this possible??
Thanks in advance!
 
F

fredg

I have a report that is an estimate of one project that may be sent to
multiple customers. For example:
The same estimate for Jones Elementary School Renovation is being sent to -
Company A, Company B, and Company C. For this example, let's assume that the
estimate for each company takes up 3 pages. I have my report set up that
after the appropriate section it forces a new page...works great!

I would like to have a page number show up on each sheet as "Page # of #",
I'd like the pages to read as follows:
1 of 3
2 of 3
3 of 3
1 of 3
2 of 3
3 of 3
1 of 3
2 of 3
3 of 3
..as apposed to: 1 of 9, 2 of 9, 3 of 9, 4 of 9, and so on.

Is this possible??
Thanks in advance!

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.
Watch out for improper word wrap

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

Slez via AccessMonster.com

Thanks for the reply!

I added ctlGrpPages, pasted that code, and made the appropriate changes, but
when I run the report I get the following error:
Run-time error '9': Subscript out of range

When I debug, it highlights the following line of code:
Me!ctlGrpPages = "Group Page " & GrpArrayPage(Me.Page) & " of " &
GrpArrayPages(Me.Page)

Any suggestions on what might be happening or how it could be fixed?
Thanks again!
Slez
I have a report that is an estimate of one project that may be sent to
multiple customers. For example:
[quoted text clipped - 18 lines]
Is this possible??
Thanks in advance!

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.
Watch out for improper word wrap

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

fredg

Thanks for the reply!

I added ctlGrpPages, pasted that code, and made the appropriate changes, but
when I run the report I get the following error:
Run-time error '9': Subscript out of range

When I debug, it highlights the following line of code:
Me!ctlGrpPages = "Group Page " & GrpArrayPage(Me.Page) & " of " &
GrpArrayPages(Me.Page)

Any suggestions on what might be happening or how it could be fixed?
Thanks again!
Slez
I have a report that is an estimate of one project that may be sent to
multiple customers. For example:
[quoted text clipped - 18 lines]
Is this possible??
Thanks in advance!

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.
Watch out for improper word wrap

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

Did you follow the other suggestions I made (Numbers 1,3, and 4)?

Without seeing what you have done, it's difficult to comment.
The code does work.
 
S

Slez via AccessMonster.com

I reviewed everything. It is possibly related to your suggestion 1. When I
first read that, I immediately thought I needed a control with the following
code:
="Page " & [Page] & " of " & [Pages]

Looking back, you had stated a control that "computes [Pages] = [Pages]".
What exactly do you mean by that? I feel I have followed everything else
perfectly.

I also just realized the the Run-Time error '9' must be representing my total
number of sheets, which is 9. Does that help identify where my problem might
be?

Thanks once again!


Thanks for the reply!
[quoted text clipped - 33 lines]
4) In the code, change Me!Salesman to
Me![Name of the control used to group by]

Did you follow the other suggestions I made (Numbers 1,3, and 4)?

Without seeing what you have done, it's difficult to comment.
The code does work.
 
F

fredg

I reviewed everything. It is possibly related to your suggestion 1. When I
first read that, I immediately thought I needed a control with the following
code:
="Page " & [Page] & " of " & [Pages]

Looking back, you had stated a control that "computes [Pages] = [Pages]".
What exactly do you mean by that? I feel I have followed everything else
perfectly.

I also just realized the the Run-Time error '9' must be representing my total
number of sheets, which is 9. Does that help identify where my problem might
be?

Thanks once again!
Thanks for the reply!
[quoted text clipped - 33 lines]
4) In the code, change Me!Salesman to
Me![Name of the control used to group by]

Did you follow the other suggestions I made (Numbers 1,3, and 4)?

Without seeing what you have done, it's difficult to comment.
The code does work.

Access automatically computes the page number [Page] when you run your
report and will display it whenever you have a control source set to,
for example, = "Page " & [Page]

However, it does not automatically compute [Pages], (the total number
of pages in the entire report).
In order for it to do so, you must include [Pages] in a control on
your report. You can simply add a control =[Pages] (and make it not
visible if you don't wish to show the total number of pages, or
include it along with the page number, i.e.
="Page " & [Page] & " of " & [Pages].
Of course that tells the total number of pages in the report, (which
is not what you want).
It also forces Access to format the report twice; once to calculate
the total number of pages (and count the number of pages in your
groups), the second time to display the report.
This is necessary for you to get the number of pages in each group.

So... make sure you have added a control that calls for [Pages].
Simply add an unbound control to the page footer.
Set it's Control Source to
=[Pages]
You can make it not visible if you don't want to show the total report
page count.

Re: Run-Time error '9'
No the 9 has nothing to do with the number of pages in your report.
It means that some variable has received some value greater than it is
expecting.
 
S

Slez via AccessMonster.com

I got it to work!
It turns out that I had a Format event in the page header that made the
affected control invisible if a certain value existed. This obviously was
throwing a wrench in to this code, because when I realized it was no longer
required, and I eliminated it, the page numbering worked perfectly! I
certainly should have realized this earlier and probably took up some of your
time unnecessarily.
Thanks again for all of your help!
Slez
I reviewed everything. It is possibly related to your suggestion 1. When I
first read that, I immediately thought I needed a control with the following
[quoted text clipped - 21 lines]
Access automatically computes the page number [Page] when you run your
report and will display it whenever you have a control source set to,
for example, = "Page " & [Page]

However, it does not automatically compute [Pages], (the total number
of pages in the entire report).
In order for it to do so, you must include [Pages] in a control on
your report. You can simply add a control =[Pages] (and make it not
visible if you don't wish to show the total number of pages, or
include it along with the page number, i.e.
="Page " & [Page] & " of " & [Pages].
Of course that tells the total number of pages in the report, (which
is not what you want).
It also forces Access to format the report twice; once to calculate
the total number of pages (and count the number of pages in your
groups), the second time to display the report.
This is necessary for you to get the number of pages in each group.

So... make sure you have added a control that calls for [Pages].
Simply add an unbound control to the page footer.
Set it's Control Source to
=[Pages]
You can make it not visible if you don't want to show the total report
page count.

Re: Run-Time error '9'
No the 9 has nothing to do with the number of pages in your report.
It means that some variable has received some value greater than it is
expecting.
 

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