Page numbering

  • Thread starter Thread starter JC
  • Start date Start date
J

JC

I have a report that is group by invoice #. On accasion, there are 2
or more pages per invoice #. How can I get the report to print page
number in each group instead of the whole report. I need it to print
'page 1 of 2' instead of 'page 1 of 67' which is the entire report.
Thanks.
 
Hi,
I'm not good at coding, so any help would be appreciated..

I have copy and paste the code in the code builder section under
(General).
I renamed 'Me!Salesperson' to 'Me!OrderNo' which is the field name for
my group.
I added an unbound text box in page footer and rename it
Me!ctlgrpPages. I not sure what I'm doing wrong but nothing is
happening, when I run the report.

Thanks.
 
JC,

Regarding:
I added an unbound text box in page footer and rename it
Me!ctlgrpPages.<

Changing 'Me!Salesperson' to 'Me!OrderNo' in the VBA code is correct.
Also retain the Me!ctlgrpPages in the VBA code.

However, do NOT NAME the Report control using the Me keyword.
Me is correctly used in the VBA code sheet to refer to the current object
(the Report in this case), however it cannot be used in an Access control's
name.
Change the name of the Page Footer control to just:
ctlgrpPages

Also make sure you have added a control to compute [Pages] in the page
footer.
Something like
="Page " & [Page] & " of " & [Pages]
or simply
= [Pages]
will do nicely.
You can make the control not visible if you don't wish to show the total
number of report pages.
 
Fred,
Thanks for your assistance, but I must still be doing something wrong.
My report has 3 sorting and grouping. The report has a order header
grouping and a product footer grouping, then a order footer for
summing.

Example...
In Page header, it has the following info...
Order #, Date, page x of xx

In Order header... nothing here.
In Product footer...
Product ABC
Product DEX, etc..

In order footer...
Total for each order #

I don't have anything in page footer. I tried adding the page
numbering there but it still says 'page 1 of 67', should be 'page 1 of
2'

I changed the control name to just 'ctlgrppages'.




Fredg said:
JC,

Regarding:
I added an unbound text box in page footer and rename it
Me!ctlgrpPages.<

Changing 'Me!Salesperson' to 'Me!OrderNo' in the VBA code is correct.
Also retain the Me!ctlgrpPages in the VBA code.

However, do NOT NAME the Report control using the Me keyword.
Me is correctly used in the VBA code sheet to refer to the current object
(the Report in this case), however it cannot be used in an Access control's
name.
Change the name of the Page Footer control to just:
ctlgrpPages

Also make sure you have added a control to compute [Pages] in the page
footer.
Something like
="Page " & [Page] & " of " & [Pages]
or simply
= [Pages]
will do nicely.
You can make the control not visible if you don't wish to show the total
number of report pages.
--
Fred

Please reply only to this newsgroup.
I do not reply to personal e-mail.


JC said:
Hi,
I'm not good at coding, so any help would be appreciated..

I have copy and paste the code in the code builder section under
(General).
I renamed 'Me!Salesperson' to 'Me!OrderNo' which is the field name for
my group.
I added an unbound text box in page footer and rename it
Me!ctlgrpPages. I not sure what I'm doing wrong but nothing is
happening, when I run the report.

Thanks.
"Fredg" <[email protected]> wrote in message
 
The control 'ctlgrpPages' , which will display the 'page 1 of 2' for the
group is to be placed in the Page Footer. That will print at the bottom of
each page. A Group Footer will only print on the last page of that group, so
placing a control to display a page number in a group footer that has more
than one page will not do any good.

Place ctlgrpPages in the PAGE FOOTER. It should then print at the bottom of
each page the page number and the total number of the pages in the current
OrderNo group.

This code does work.
Why don't you make a simple report with just one group from your current
data.
Use this code to display the group page numbers.
When you get it working, then add a second group, then a third.
By first getting the simpler report to properly run, you can then more
easily debug a more sophisticated report.

--
Fred

Please reply only to this newsgroup.
I do not reply to personal e-mail.


JC said:
Fred,
Thanks for your assistance, but I must still be doing something wrong.
My report has 3 sorting and grouping. The report has a order header
grouping and a product footer grouping, then a order footer for
summing.

Example...
In Page header, it has the following info...
Order #, Date, page x of xx

In Order header... nothing here.
In Product footer...
Product ABC
Product DEX, etc..

In order footer...
Total for each order #

I don't have anything in page footer. I tried adding the page
numbering there but it still says 'page 1 of 67', should be 'page 1 of
2'

I changed the control name to just 'ctlgrppages'.




JC,

Regarding:
I added an unbound text box in page footer and rename it
Me!ctlgrpPages.<

Changing 'Me!Salesperson' to 'Me!OrderNo' in the VBA code is correct.
Also retain the Me!ctlgrpPages in the VBA code.

However, do NOT NAME the Report control using the Me keyword.
Me is correctly used in the VBA code sheet to refer to the current object
(the Report in this case), however it cannot be used in an Access control's
name.
Change the name of the Page Footer control to just:
ctlgrpPages

Also make sure you have added a control to compute [Pages] in the page
footer.
Something like
="Page " & [Page] & " of " & [Pages]
or simply
= [Pages]
will do nicely.
You can make the control not visible if you don't wish to show the total
number of report pages.
--
Fred

Please reply only to this newsgroup.
I do not reply to personal e-mail.


JC said:
Hi,
I'm not good at coding, so any help would be appreciated..

I have copy and paste the code in the code builder section under
(General).
I renamed 'Me!Salesperson' to 'Me!OrderNo' which is the field name for
my group.
I added an unbound text box in page footer and rename it
Me!ctlgrpPages. I not sure what I'm doing wrong but nothing is
happening, when I run the report.

Thanks.
"Fredg" <[email protected]> wrote in message
Look at the Reports section at:
http://www.mvps.org/access

--
Fred

Please reply only to this newsgroup.
I do not reply to personal e-mail.


I have a report that is group by invoice #. On accasion, there are 2
or more pages per invoice #. How can I get the report to print page
number in each group instead of the whole report. I need it to print
'page 1 of 2' instead of 'page 1 of 67' which is the entire report.
Thanks.
[/QUOTE]
 
Fred,
Thanks.. I was able to take it apart and add them back section by
section. Now I have a page numbering on the page footer. Now it
reads 'page 1 of 4' ,then come second order.. 'page 1 of 4'. The
begining number is correct because it starts with a 1 on each new
order#, but how can I modify it so that it can read 'page 1 of 1'? Is
there another step or again did I miss something?

Fredg said:
The control 'ctlgrpPages' , which will display the 'page 1 of 2' for the
group is to be placed in the Page Footer. That will print at the bottom of
each page. A Group Footer will only print on the last page of that group, so
placing a control to display a page number in a group footer that has more
than one page will not do any good.

Place ctlgrpPages in the PAGE FOOTER. It should then print at the bottom of
each page the page number and the total number of the pages in the current
OrderNo group.

This code does work.
Why don't you make a simple report with just one group from your current
data.
Use this code to display the group page numbers.
When you get it working, then add a second group, then a third.
By first getting the simpler report to properly run, you can then more
easily debug a more sophisticated report.

--
Fred

Please reply only to this newsgroup.
I do not reply to personal e-mail.


JC said:
Fred,
Thanks for your assistance, but I must still be doing something wrong.
My report has 3 sorting and grouping. The report has a order header
grouping and a product footer grouping, then a order footer for
summing.

Example...
In Page header, it has the following info...
Order #, Date, page x of xx

In Order header... nothing here.
In Product footer...
Product ABC
Product DEX, etc..

In order footer...
Total for each order #

I don't have anything in page footer. I tried adding the page
numbering there but it still says 'page 1 of 67', should be 'page 1 of
2'

I changed the control name to just 'ctlgrppages'.




"Fredg" <[email protected]> wrote in message
JC,

Regarding:
I added an unbound text box in page footer and rename it
Me!ctlgrpPages.<

Changing 'Me!Salesperson' to 'Me!OrderNo' in the VBA code is correct.
Also retain the Me!ctlgrpPages in the VBA code.

However, do NOT NAME the Report control using the Me keyword.
Me is correctly used in the VBA code sheet to refer to the current object
(the Report in this case), however it cannot be used in an Access control's
name.
Change the name of the Page Footer control to just:
ctlgrpPages

Also make sure you have added a control to compute [Pages] in the page
footer.
Something like
="Page " & [Page] & " of " & [Pages]
or simply
= [Pages]
will do nicely.
You can make the control not visible if you don't wish to show the total
number of report pages.
--
Fred

Please reply only to this newsgroup.
I do not reply to personal e-mail.


Hi,
I'm not good at coding, so any help would be appreciated..

I have copy and paste the code in the code builder section under
(General).
I renamed 'Me!Salesperson' to 'Me!OrderNo' which is the field name for
my group.
I added an unbound text box in page footer and rename it
Me!ctlgrpPages. I not sure what I'm doing wrong but nothing is
happening, when I run the report.

Thanks.
"Fredg" <[email protected]> wrote in message
Look at the Reports section at:
http://www.mvps.org/access

--
Fred

Please reply only to this newsgroup.
I do not reply to personal e-mail.


I have a report that is group by invoice #. On accasion, there are 2
or more pages per invoice #. How can I get the report to print page
number in each group instead of the whole report. I need it to print
'page 1 of 2' instead of 'page 1 of 67' which is the entire report.
Thanks.
 
Back
Top