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.