Page numbering by page of record

  • Thread starter Thread starter AP
  • Start date Start date
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?
 
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
 
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.
 
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"?
 
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.
 
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.
 
Back
Top