Reset page numbers for groups

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

Guest

Hi all. I am a new to this so bear with me. I have followed these
instructions below from another post to reset the page numbers for each
group. I am getting an error and I am not sure what I am doing wrong. The
code appears to cycle through all my groups but then gets caught up after the
last one.

Error: Script out of range. The code gets stuck here:
Me!ctlGrpPages = "Group Page " & GrpArrayPage(Me.Page) = <Script out of Range>

I have an unbound text box with the name ctlGrpPages.
I have another text box with the control source =[Pages]=[Pages]
I have a text box with ="Page " & [Page] & " of " & [Pages]


This is the code I followed. Any advice is GREATLY appreciated!!!
"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]
 
Hi all. I am a new to this so bear with me. I have followed these
instructions below from another post to reset the page numbers for each
group. I am getting an error and I am not sure what I am doing wrong. The
code appears to cycle through all my groups but then gets caught up after the
last one.

Error: Script out of range. The code gets stuck here:
Me!ctlGrpPages = "Group Page " & GrpArrayPage(Me.Page) = <Script out of Range>

I have an unbound text box with the name ctlGrpPages.
I have another text box with the control source =[Pages]=[Pages]
I have a text box with ="Page " & [Page] & " of " & [Pages]

This is the code I followed. Any advice is GREATLY appreciated!!!
"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]

You have added one unnecessary control which is probably causing the
problem.
= [Pages] = [Pages]
You miss-interpreted the control source.
The line ending with " that computes [Pages]" was the end of the
sentence.
=[Pages]
was the controls source.

Your =[Pages] = [Pages] will always evaluate to -1 (True), [Pages]
always = [Pages].

You already have your control that calculates Pages:
="Page " & [Page] & " of " & [Pages]
This one is all you need.

You can delete =[Pages] = [Pages].
 
Back
Top