New "Page 1 of ..." Number at change in GroupHeader2

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I would like to have a new "Page 1 of 3" (or whatever the page number ends up
being) at each change in GroupHeader2. For example, I have a report for each
Task number. Each task number is summarized in the Detail section with a
total section in the GroupFooter2 section. Whenever the Task Number changes,
I want it to be reflected in the page footer that this is now "Page 1 of .."
whatever, and the report continues to print. This would be much like if I
were to print each task number as an individual report. But with about 20
tasks, I'd rather keep it in one report.

Can you help me with that?
 
Cydney said:
I would like to have a new "Page 1 of 3" (or whatever the page number ends up
being) at each change in GroupHeader2. For example, I have a report for each
Task number. Each task number is summarized in the Detail section with a
total section in the GroupFooter2 section. Whenever the Task Number changes,
I want it to be reflected in the page footer that this is now "Page 1 of .."
whatever, and the report continues to print. This would be much like if I
were to print each task number as an individual report. But with about 20
tasks, I'd rather keep it in one report.

Can you help me with that?


Check this article:
http://support.microsoft.com/kb/104760/en-us
 
thanks. However, that didn't seem to work for me. do you suppose it behaves
differently in Access 2003? I used instructions for MS 1.x and 2.0..
 
Actually.. I take that back .. it did work. But what I don't have is a number
"2" for the 2nd page. I get "1 of 29" instead of "1 of 2". How can I get it
to determine how many pages it will be before the next header change?
 
Actually.. I take that back .. it did work. But what I don't have is a number
"2" for the 2nd page. I get "1 of 29" instead of "1 of 2". How can I get it
to determine how many pages it will be before the next header change?

You probably missed a step.

Try this method.

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], i.e.
= [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]
 
This example worked perfectly! Thank you!
--
THX cs


fredg said:
Actually.. I take that back .. it did work. But what I don't have is a number
"2" for the 2nd page. I get "1 of 29" instead of "1 of 2". How can I get it
to determine how many pages it will be before the next header change?

You probably missed a step.

Try this method.

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], i.e.
= [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]
 
Now another issue has come up.
They want the Report Header to appear on every "Page 1 of 2" and the Page
Header to appear on the "Page 2 of 2". I know how to do that on general
reports, but how do I make the report header reappear after the actual page
1??
--
THX cs


Cydney said:
This example worked perfectly! Thank you!
--
THX cs


fredg said:
Actually.. I take that back .. it did work. But what I don't have is a number
"2" for the 2nd page. I get "1 of 29" instead of "1 of 2". How can I get it
to determine how many pages it will be before the next header change?

You probably missed a step.

Try this method.

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], i.e.
= [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]
 
Now another issue has come up.
They want the Report Header to appear on every "Page 1 of 2" and the Page
Header to appear on the "Page 2 of 2". I know how to do that on general
reports, but how do I make the report header reappear after the actual page
1??

Sorry. The report header will only appear on page 1 of the entire
report.
I would suggest you place all of the report header controls that you
wish to display on Page 1 of each group into the Group Header. Set the
Group Header Repeat Section property to yes. It will now appear on
every page. To get the special controls to show only on the 1st page
of every group, code the Group Header PRINT event:

ControlName1.Visible = GrpArrayPage(Me.Page) < 2
ControlName2.Visible = GrpArrayPage(Me.Page) < 2
etc....

Do the same for each control you only want to display on Group Page 1.
 
I'm sort of there... but it doesn't seem to show up on my "Page 2" ..
I have to subreports in my Group Header. Here's my code for that header:

Private Sub GroupHeader0_Print(Cancel As Integer, PrintCount As Integer)
'Makes fields visible based on Page Number
headClientLogo.Visible = GrpArrayPage(Me.page) < 2
headClientNoLogo.Visible = GrpArrayPage(Me.page) > 1
End Sub

It's pretty weird. The right header appears on the first page, but only
sporadically after that. Even though the code seems to be responding right
(i.e. "True" when it should appear and "False" when it shouldn't).

Any more ideas??
 
I'm sort of there... but it doesn't seem to show up on my "Page 2" ..
I have to subreports in my Group Header. Here's my code for that header:

Private Sub GroupHeader0_Print(Cancel As Integer, PrintCount As Integer)
'Makes fields visible based on Page Number
headClientLogo.Visible = GrpArrayPage(Me.page) < 2
headClientNoLogo.Visible = GrpArrayPage(Me.page) > 1
End Sub

It's pretty weird. The right header appears on the first page, but only
sporadically after that. Even though the code seems to be responding right
(i.e. "True" when it should appear and "False" when it shouldn't).

Any more ideas??

With sub-reports in the Group Header it may be a question of timing.
You might try moving the
headClientLogo.Visible = GrpArrayPage(Me.page) < 2
headClientNoLogo.Visible = GrpArrayPage(Me.page) > 1
code to a different event. I know it cannot be in the GroupHeader
Format event. Try thePage Header Print event.
Also try setting the criteria within it's own set of parenthesis.
headClientLogo.Visible = (GrpArrayPage(Me.page) < 2)
headClientNoLogo.Visible = (GrpArrayPage(Me.page) > 1)

Not much more I can say, as I have no way to test with sub-reports in
the Group Header.
Works fine without sub-reports.
 
Well, I fixed the problem....
I simply couldn't find a way to use subreports in this process. So I removed
those and put the fields and labels back in the way I wanted them. That
seemed to work the best (as you stated). Then some of them were looking a bit
funky on pages after page 1 where some of the rows would overlap each other
but looked perfect on Page 1. (On page 1 I have about 10 lines of logo and
address information, but on page 2 I just have 1 line.) So I changed all the
"Can Shrink/Can Grow" options to "No" and although it kept the height larger
than it needed to be for "Page 2", it looked better than the alternative and
no fields wrote on top of the other ones.

If anyone has more ideas about this let me know.
 
Back
Top