Page Number Update by Group?

C

Charles

We have a report with Text Box Control ="Page " & [Page] in its Page Footer.
We'd like this to restart at Page 1 for each group and still appear at the
bottom of the page (as opposed to the end of the group which may or may not
be the bottom of the page).

Any ideas how?

Thanks!
 
F

fredg

We have a report with Text Box Control ="Page " & [Page] in its Page Footer.
We'd like this to restart at Page 1 for each group and still appear at the
bottom of the page (as opposed to the end of the group which may or may not
be the bottom of the page).

Any ideas how?

Thanks!

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]
 
C

Charles

I did as described but nothing shows in the ctlGrpPages Text Box and the
PageNo control (with ="Page " & [Page] as its control source) continues to
increment up as if the grouping didn't exist. So even though the second page
and third page are both new groups, they are numbered Page 2 and Page 3.

Any thoughts?

Thanks!
--
Charles


fredg said:
We have a report with Text Box Control ="Page " & [Page] in its Page Footer.
We'd like this to restart at Page 1 for each group and still appear at the
bottom of the page (as opposed to the end of the group which may or may not
be the bottom of the page).

Any ideas how?

Thanks!

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 Spencer

Try to reset the page number to 1 in the group header on print event

Private Sub GroupHeader1_Print(Cancel As Integer, PrintCount As Integer)
Me.Page = 1
End Sub

If you are trying to print Page N of N Pages, then this is not the
solution, but if all you want is to start the page number over with each
group this should work for you.

--
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
..
 
C

Charles

We're getting closer!

However, this makes every page Page one, even when a group has three or four
pages.

Any further thoughts?

Thanks!
--
Charles



John Spencer said:
Try to reset the page number to 1 in the group header on print event

Private Sub GroupHeader1_Print(Cancel As Integer, PrintCount As Integer)
Me.Page = 1
End Sub

If you are trying to print Page N of N Pages, then this is not the
solution, but if all you want is to start the page number over with each
group this should work for you.

--
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
..

Charles said:
We have a report with Text Box Control ="Page " & [Page] in its Page
Footer.
We'd like this to restart at Page 1 for each group and still appear at the
bottom of the page (as opposed to the end of the group which may or may
not
be the bottom of the page).

Any ideas how?

Thanks!
 
J

John Spencer

I just tried it here and it seems to work for me. (Access 2003).

Using the Group Headers property to set page break before header
and using

Private Sub GroupHeader4_Print(Cancel As Integer, PrintCount As Integer)
Page = 1
End Sub


--
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
..

Charles said:
We're getting closer!

However, this makes every page Page one, even when a group has three or
four
pages.

Any further thoughts?

Thanks!
--
Charles



John Spencer said:
Try to reset the page number to 1 in the group header on print event

Private Sub GroupHeader1_Print(Cancel As Integer, PrintCount As Integer)
Me.Page = 1
End Sub

If you are trying to print Page N of N Pages, then this is not the
solution, but if all you want is to start the page number over with each
group this should work for you.

--
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
..

"Charles" <CUdell(reversetheloatoaolandremovebetweenparens)@loa.com>
wrote
in message news:[email protected]...
We have a report with Text Box Control ="Page " & [Page] in its Page
Footer.
We'd like this to restart at Page 1 for each group and still appear at
the
bottom of the page (as opposed to the end of the group which may or may
not
be the bottom of the page).

Any ideas how?

Thanks!
 
C

Charles

Still no luck and I am also using Access 2003. Have you got any special
References running in your VB Module?

Thansk!
--
Charles


John Spencer said:
I just tried it here and it seems to work for me. (Access 2003).

Using the Group Headers property to set page break before header
and using

Private Sub GroupHeader4_Print(Cancel As Integer, PrintCount As Integer)
Page = 1
End Sub


--
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
..

Charles said:
We're getting closer!

However, this makes every page Page one, even when a group has three or
four
pages.

Any further thoughts?

Thanks!
--
Charles



John Spencer said:
Try to reset the page number to 1 in the group header on print event

Private Sub GroupHeader1_Print(Cancel As Integer, PrintCount As Integer)
Me.Page = 1
End Sub

If you are trying to print Page N of N Pages, then this is not the
solution, but if all you want is to start the page number over with each
group this should work for you.

--
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
..

"Charles" <CUdell(reversetheloatoaolandremovebetweenparens)@loa.com>
wrote
in message We have a report with Text Box Control ="Page " & [Page] in its Page
Footer.
We'd like this to restart at Page 1 for each group and still appear at
the
bottom of the page (as opposed to the end of the group which may or may
not
be the bottom of the page).

Any ideas how?

Thanks!
 

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