Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Control Page# when the Report Group Header changes

Status
Not open for further replies.

MaggieLeatherman

Programmer
May 9, 2004
59
0
0
US
I have a report with a Group Header on SRNumber. When I run the report, on the Page Footer it shows Page 1 of 15.

I need the page # to reset every time the SRNumber changes and show this on the botton of the page.
For example:
SRNumber = 501-4 Page 1 of 2 etc.
" 501-12 Page 1 of 4
" 501-90 Page 1 of 1
" 501-98 Page 1 of 8
NOT Page 1 of 15
Page 2 of 15 etc.
Thanks for your help, Maggie
 
Could something like this work for you? I use this in a report's page footer that I run for two different categories...

Code:
="Page " & IIf([Forms]![frmMain].[txtSemester]="Sprg",[Page]+3,IIf([StudentType]="Freshmen",[Page]+9,[Page]+11))

If your condition is based on a group change, you may need to use vba based on the sorting and grouping conditions rather than hard coding into the text box as I did above.
 
Hello, While looking at your example, I don't know where you got the numbert ex. + 9, How did you know how many pages to add to [Page]?

I guess I would need to control this based on a group change, ex: whenever the SRNumber Group changes, i'd need to start the page count over...

I'm still fuzzy on where to go. Thanks, Margaret
 
Sorry if my explanation wasn't too clear, the example I pasted was what I actually was using on one of my reports, I didn't modify it to your situation, just put it out there to give an idea, as I mentioned that you would probably need to do something with vba since your conditions are changing based on grouping while mine is based on what the user selects as a filter on a form. For my report, the page numbering isn't resetting to 1, it is continuing at a higher number because we eventually compile the reports into one pdf file and insert pages from a different report in between so that is why one of the conditions add 9 to the page number.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top