Page numbering by page of record

A

AP

Hi,

I have an access report that is generated the office level (officeID).
There are multiple customers (customerID) associated with each office. When
I run the report and apply page numbers, Access returns page numbers for the
entire report. Ie. "Page 1 or 564". I would like the customerID to drive
the page numbers. Ie. each customerID will have a listing in the page header
that reads "Page 1 of 5" or "Page 1 of2". Is this possible? Can it be done
in design view, not VB?
 
F

fredg

Hi,

I have an access report that is generated the office level (officeID).
There are multiple customers (customerID) associated with each office. When
I run the report and apply page numbers, Access returns page numbers for the
entire report. Ie. "Page 1 or 564". I would like the customerID to drive
the page numbers. Ie. each customerID will have a listing in the page header
that reads "Page 1 of 5" or "Page 1 of2". Is this possible? Can it be done
in design view, not VB?

See:
"Printing First and Last Page Numbers for Report Groups "
http://www.mvps.org/access/reports/rpt0013.htm
 
F

fredg

Thanks. Is there a way to apply the code into design view? I'm VERY new to
Access.

I'm afraid I don't understand your question.
What do you mean by 'apply the code into design view' ?
The only way to add the code to the report is in design view. Is that
what you meant? I think if you have a question you need to think it
through and ask it in a manner that someone who can't see your
computer will understand it.
Read through the instructions that are included with the link I gave
you first.
 
A

AP

Thanks for the continuing help with the and apologies for the basic
questions. Hope this makes more sense:

From Design View, I selected "View" and then "Code" to open Visual Basic.
Is this the same thing as opening the "Code-Behind-Reports" module?

In VB, I pasted the "Complete Code Listing" from the MVPS website, beginning
with the "Option Compare Database" line.

I changed "Me!Salesperson" to "Me.Customer_ID" as “Customer_ID†is the level
that I would like to see the page numbers at.

I am not sure what to change "Me!CtlGrpPages" to. Is this the new field
that I will drag on to my report in design view? Will it appear on the Field
List?

I would like this newly created field to appear in the header, should I
replace "Private Sub PageFooter_Format" with "Private Sub PageHeader_Format"?
 
F

fredg

On Mon, 3 Aug 2009 12:12:01 -0700, AP wrote:

See my comments in line below.
Thanks for the continuing help with the and apologies for the basic
questions. Hope this makes more sense:

From Design View, I selected "View" and then "Code" to open Visual Basic.
Is this the same thing as opening the "Code-Behind-Reports" module?

In VB, I pasted the "Complete Code Listing" from the MVPS website, beginning
with the "Option Compare Database" line.

OK. This is fine.
I changed "Me!Salesperson" to "Me.Customer_ID" as ´Customer_ID¡ is the level
that I would like to see the page numbers at.

This too is correct.
I am not sure what to change "Me!CtlGrpPages" to. Is this the new field
that I will drag on to my report in design view? Will it appear on the Field
List?

First you must add a control (unbound, from the Toolbox, not from the
Field List) to the Page Footer section.
Name this control
CtlGrpPages

I would like this newly created field to appear in the header, should I
replace "Private Sub PageFooter_Format" with "Private Sub PageHeader_Format"?

No! The [CtlGrpPages] control must remain in the Page Footer and the
code must remain in the Page Footer Format event.
If you do not wish to display the Page/Pages in the Page Footer you
can make this control Not Visible to hide it.

To show the pages in the Page Header instead of the Page Footer....
Also add another unbound control (from the Toolbox) to the Page
Header.
Then, code the PageHeader Format event:

Me.txtHeaderGroup = "Group Page " & GrpArrayPage(Me.Page) & " of " &
GrpArrayPages(Me.Page)

I hope this helps.
 
A

AP

I have two more questions below. Thanks again.
First you must add a control (unbound, from the Toolbox, not from the
Field List) to the Page Footer section.
Name this control
CtlGrpPages
 I would like this newly created field to appear in the header, should I
replace "Private Sub PageFooter_Format" with "Private Sub PageHeader_Format"?

No! The [CtlGrpPages] control must remain in the Page Footer and the
code must remain in the Page Footer Format event.
If you do not wish to display the Page/Pages in the Page Footer you
can make this control Not Visible to hide it.

To show the pages in the Page Header instead of the Page Footer....
Also add another unbound control (from the Toolbox) to the Page
Header.
Then, code the PageHeader Format event:

Me.txtHeaderGroup = "Group Page " & GrpArrayPage(Me.Page) & " of " &
GrpArrayPages(Me.Page)

I hope this helps.


fredg said:
On Mon, 3 Aug 2009 12:12:01 -0700, AP wrote:

See my comments in line below.
Thanks for the continuing help with the and apologies for the basic
questions. Hope this makes more sense:

From Design View, I selected "View" and then "Code" to open Visual Basic.
Is this the same thing as opening the "Code-Behind-Reports" module?

In VB, I pasted the "Complete Code Listing" from the MVPS website, beginning
with the "Option Compare Database" line.

OK. This is fine.
I changed "Me!Salesperson" to "Me.Customer_ID" as “Customer_ID†is the level
that I would like to see the page numbers at.

This too is correct.
I am not sure what to change "Me!CtlGrpPages" to. Is this the new field
that I will drag on to my report in design view? Will it appear on the Field
List?

First you must add a control (unbound, from the Toolbox, not from the
Field List) to the Page Footer section.
Name this control
CtlGrpPages

I would like this newly created field to appear in the header, should I
replace "Private Sub PageFooter_Format" with "Private Sub PageHeader_Format"?

No! The [CtlGrpPages] control must remain in the Page Footer and the
code must remain in the Page Footer Format event.
If you do not wish to display the Page/Pages in the Page Footer you
can make this control Not Visible to hide it.

To show the pages in the Page Header instead of the Page Footer....
Also add another unbound control (from the Toolbox) to the Page
Header.
Then, code the PageHeader Format event:

Me.txtHeaderGroup = "Group Page " & GrpArrayPage(Me.Page) & " of " &
GrpArrayPages(Me.Page)

I hope this helps.
 

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