Page Numbers broken down in sections

J

jas0n

I have a report which gives the page numbers at the bootom of each page,
works fine:-

Using
="Page " & [Page] & " of " & [Pages]

The report is for several cost centres. How can I put in page 1 of x for
each section between page breaks so rather than seeing the overall report
page total it shows the pages per cost centre as the report is broken down
and handed to each cost centre and I dont want them looking for missing
pages that are not part of their report.
 
F

fredg

I have a report which gives the page numbers at the bootom of each page,
works fine:-

Using
="Page " & [Page] & " of " & [Pages]

The report is for several cost centres. How can I put in page 1 of x for
each section between page breaks so rather than seeing the overall report
page total it shows the pages per cost centre as the report is broken down
and handed to each cost centre and I dont want them looking for missing
pages that are not part of their report.

Group the report View + Sorting and Groupng) by Cost Center.
Then 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]
 
J

John Keith

I am trying to get this to work and having a lot of trouble fighting
access... Probably this is a whole lot of stupid mistakes on my part. I am
brand new to Access - Reports.
Group the report View + Sorting and Groupng) by Cost Center.
The report is already page breaking on "Location" like I want it to (I also
have the report printing in 3-columns, but page numbering is correct... 1 of
287, 2 of 287 and so on. But I have 72 different locations and I want the
[pages] to be the total number in the group. But this could mean I am not
even looking in the right direction to start with...
Then see:

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

The visual basic code makes perfect sense to me, how to make access USE this
code is what is causing problems.
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.
I keep getting an invalid control when I try to add this. I already have
=[pages] being referenced and it shows the total pages in the complete
report. Is this still necessary? Is this to force the event handler to fire
the PageFooter_Format code?
2) Add an unbound control to the Page Footer.
Name this control "ctlGrpPages"
I have added a textbox and changed it's name to "ctlGrpPages". Inside the
textbox it says "Unbound" but this doesn't seem to do anything at all when I
run the report.
I have also tried naming the textbox Textbox99 and pointing it's control
source to =[ctlGrpPages] which thinks it is an input parameter when I try to
view the report. I also tried [me!cntlGrpPages] AND [me]![cntlGrpPages]
neither of which had any success.
3) Paste the code into the Page Footer Format event.
I "think" I did this correctly... I clicked the "Code" toolbar button which
launched the VBE and I added the complete code listing verbatim. I tried
adding a STOP statement but I was not able to get the code to pause at all
(probably a result of the other supporting set up not being correct)
4) In the code, change Me!Salesman to
Me![Name of the control used to group by]
Changed to: GrpNameCurrent = Me!Location
Location is the name of my query field that is the control break field being
used.
 
J

John Keith

SUCCESS!

The problem was that the Event name used in Visual basic was wrong
the event name "PageFooter_Format" must be for a version prior to
Office2003. The correct event name is "PageFooterSection_Format"

And the "Unbound" text showing INSIDE the text box named "ctlGrpPages" was
the correct way to reference the new control that was being populated by the
VB code.

--
Regards,
John


John Keith said:
I am trying to get this to work and having a lot of trouble fighting
access... Probably this is a whole lot of stupid mistakes on my part. I am
brand new to Access - Reports.
Group the report View + Sorting and Groupng) by Cost Center.
The report is already page breaking on "Location" like I want it to (I also
have the report printing in 3-columns, but page numbering is correct... 1 of
287, 2 of 287 and so on. But I have 72 different locations and I want the
[pages] to be the total number in the group. But this could mean I am not
even looking in the right direction to start with...
Then see:

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

The visual basic code makes perfect sense to me, how to make access USE this
code is what is causing problems.
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.
I keep getting an invalid control when I try to add this. I already have
=[pages] being referenced and it shows the total pages in the complete
report. Is this still necessary? Is this to force the event handler to fire
the PageFooter_Format code?
2) Add an unbound control to the Page Footer.
Name this control "ctlGrpPages"
I have added a textbox and changed it's name to "ctlGrpPages". Inside the
textbox it says "Unbound" but this doesn't seem to do anything at all when I
run the report.
I have also tried naming the textbox Textbox99 and pointing it's control
source to =[ctlGrpPages] which thinks it is an input parameter when I try to
view the report. I also tried [me!cntlGrpPages] AND [me]![cntlGrpPages]
neither of which had any success.
3) Paste the code into the Page Footer Format event.
I "think" I did this correctly... I clicked the "Code" toolbar button which
launched the VBE and I added the complete code listing verbatim. I tried
adding a STOP statement but I was not able to get the code to pause at all
(probably a result of the other supporting set up not being correct)
4) In the code, change Me!Salesman to
Me![Name of the control used to group by]
Changed to: GrpNameCurrent = Me!Location
Location is the name of my query field that is the control break field being
used.
 

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