Page Numbers on Reports with Subreports

  • Thread starter Thread starter awonson
  • Start date Start date
A

awonson

Guest
I have created a database for my school made up of several tables. A union query brings this data together and it is represented on a transcript that is printed for each student in a given year group. This transcript is a report with a subreport. The main report contains the student's name while the subreport lists the awards and achievements for that student listed under each calendar year.

How do I place a page number on the bottom of each transcript that says: "Page X of Y"? This needs to work when the option to print only one student's transcript is selected as well as the option to print transcripts for ALL students in a given academic year (as in one print run).

In this second case, all transcripts would be listed for every student in the year group. The first student's tanscript would have (for example) page 1 of 2 followed by page 2 of 2. Then the next student's transcript would display (for example) page 1 of 3, page 2 of 3, page 3 of 3; followed by the next student.

I would appreciate any help on this matter.
Many thanks, Andrew
 
Rich,

Thanks for the reference. However, I tried this but still no page numbers appear.

In my example the subreport is the union query. The main report is made up of Page Header, Detail and Page Footer. The student's surname is found in the Page Header. As a result, their name appears on the top of every page of their transcript along with the school crest. The subreport sections are: Calendar Year Header, Category Header, Detail.

Thanks again.
 
Did you find any solution to your page numbering problem? I have just posted an almost identical problem please read it and see if you could help me?
Thanks!
 
Happy YN,

I tried the code from the web site above and had no luck. I saw your post regarding the same problem. I am still searching for a solution!

Andrew
 
Thanks!
The worst thing is that I did manage to get it to work - I could not believe that I was seeing right but I didn't save it then and now I can't get it! I did not understand in that code the Pagefooter_format part, I can only get pagefootersection_format and when I tried substituting that it said it does not recognise the groupheader??!
There must be some way - lets try renewing our efforts to crack it.
By the way did you read my way that was to create a control which contains the number of pupils on the report and then to divide "pages" by it which would give a value for the pages of the group . I managed to get the number but I cannot divide pages by something in the report footer - something to do with reformatting the report a second time! If I can crack that part I think I've got there Please help!
 
OK Happy, let's assume your grouping by Pupil and the control source is say PupilName, on the other tab change the name to Salesperson since the example code references that name. In order for the code to work you also have to add the page &no of pages etc from the Insert menu, add it to the page footer and hide it. Providing the other instructions have been followed it will work.
HTH
 
thanks rich!
what dyou mean by controlsource? dyou mean thr groupheadername? & which tab are you refering to? also shouldnt I better change salesperson in the code to my controlname?
thanks will try it anyway & let you know
PS did you read my problem about referencing previous record for a pupil in the db. I posted it today?
thanks awfully again
 
Rich! Feel bad to bother you but it did not work. by the way for some strange reason =page of pages shows 0 of 16 ??? if I put it in the footer but it works fine in the header? I still don't understand what you meant by controlsource nor by tab (dyou mean the tab in the property box?) thanks for the other tip re prevRecVal have located info seems just what I need but I need time to modify it. This pages thing is bothering me more than anything else and i need it solved urgently. Please help asap
with renewed thanks
Happy YN
 
Hi,

Apologies for dragging this out of the archives, but I have just been attempting to do this on a report to no avail.

I have been attempting it on a report WITHOUT a sub report though, so maybe I'm barking up the wrong tree here.

I think that the bit that is causing me problems is where the I am supposed to to enter the control source name. The instructions say "Me!ctlGrpPages is the name of a control you should place in the page footer."

Should I type this exactly as it appears here? or simply call the control source GrpPages?:confused:

Cheers
 
Hi! Back to this page numbering in reports.
Rich pointed to an article in www.mvps which was very good but did not work properly. About 2 weeks ago someone sent me an email saying there was a spelling error in the code and he got it to work!
Unfortunately I was away from home then, picked up the email on my wap phone and replied with thanks but somehow it has been deleted and I don't even know the sender so this is an appeal for whoever it was to please post the information again either on the forum or to my email THANKS!
 
Rich! Please do not think that I am being ungrateful to you for your help then On the contrary I very much appreciated your concern that it should work. Unfortunately the code you modified for me in your 97 db didn't work once I converted it to 2000. In its state as in mvps there is some error which did not let the pages number correctly but I can't remember what. All I know is that I spent a long time playing with it to no avail and in the end gave up! then whoever it was emailed me that there was this spelling error in one line and he got it to work but as I mentioned I have lost all trace of this email before I could examine if that was the problem. I am willing to give this a try all over again if there is a chance that I may break through (with your help!!?)
Incidentally why are you still on 97 and not on 2000?
Best wishes
Happy YN
 
Can't help with the spelling Happy, I know it works in 97 and that's one of the reasons I'm not prepared to "upgrade".
When Microsoft actually makes what I consider to be "improvements" to the 97 version, I'll purchase it.
Until then I've no intention of contributing to the keep BG rich fund:mad:
 

Users who are viewing this thread

Back
Top Bottom