Manually Reset Page Number Problem

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

Guest

I followed the thread started on 6/15/05 between sjkrause and fredg about
manually resetting page numbers. I used the code given there, and made the
appropriate corrections for my needs. The adjusted code worked correctly for
the first two reports I created, but it is not working for another report I
need in a different database. It is combining all the "groups" together
except the last one. Thus my page numbers are appearing Page 1 of 127, and
then Page 1 of 1. Am I doing something wrong with my grouping and sorting?
I've looked at everything very carefully but am beginning to think I'm
overlooking the obvious.

I am using Access 2000.
 
I followed the thread started on 6/15/05 between sjkrause and fredg about
manually resetting page numbers. I used the code given there, and made the
appropriate corrections for my needs. The adjusted code worked correctly for
the first two reports I created, but it is not working for another report I
need in a different database. It is combining all the "groups" together
except the last one. Thus my page numbers are appearing Page 1 of 127, and
then Page 1 of 1. Am I doing something wrong with my grouping and sorting?
I've looked at everything very carefully but am beginning to think I'm
overlooking the obvious.

I am using Access 2000.

Articles from 6/15 are no longer on my computer.
If memory serves me, he was trying to print page 1 of 3, 2 of 3, etc.
for each group of records on a report, using code from
http://www.mvps.org/access/reports/rpt0013.htm

If it works for 2 reports, but not the 3rd, it is logical to assume
you have something in that 3rd report that is different.

Perhaps it is your Sorting and Grouping.
But I don't know what you are grouping on.

Things to check:
1) Did you add a control to the Page Footer to calculate pages
=[Pages]

2) Write [Event Procedure] on the Group Footer Format event line, and
then paste the code into the Format event Sub.

3) Did you change the line of code that reads:
GrpNameCurrent = Me!Salesperson
to
GrpNameCurrent = Me![Whatever field the Report is Grouped on]

4) Did you dim the appropriate variables in the Declaration's section
of the code:

Option Compare Database
Option Explicit

Dim GrpArrayPage(), GrpArrayPages()
Dim GrpNameCurrent As Variant, GrpNamePrevious As Variant
Dim GrpPage As Integer, GrpPages As Integer
=============

5) Did you add a control to the Group Footer to display the page
numbers? Did you name it "ctlGrpPages"?

Best I can do for you with the information given.
Hope this helps.
 
fredg said:
I followed the thread started on 6/15/05 between sjkrause and fredg about
manually resetting page numbers. I used the code given there, and made the
appropriate corrections for my needs. The adjusted code worked correctly for
the first two reports I created, but it is not working for another report I
need in a different database. It is combining all the "groups" together
except the last one. Thus my page numbers are appearing Page 1 of 127, and
then Page 1 of 1. Am I doing something wrong with my grouping and sorting?
I've looked at everything very carefully but am beginning to think I'm
overlooking the obvious.

I am using Access 2000.

Articles from 6/15 are no longer on my computer.
If memory serves me, he was trying to print page 1 of 3, 2 of 3, etc.
for each group of records on a report, using code from
http://www.mvps.org/access/reports/rpt0013.htm

If it works for 2 reports, but not the 3rd, it is logical to assume
you have something in that 3rd report that is different.

Perhaps it is your Sorting and Grouping.
But I don't know what you are grouping on.

Things to check:
1) Did you add a control to the Page Footer to calculate pages
=[Pages]

2) Write [Event Procedure] on the Group Footer Format event line, and
then paste the code into the Format event Sub.

3) Did you change the line of code that reads:
GrpNameCurrent = Me!Salesperson
to
GrpNameCurrent = Me![Whatever field the Report is Grouped on]

4) Did you dim the appropriate variables in the Declaration's section
of the code:

Option Compare Database
Option Explicit

Dim GrpArrayPage(), GrpArrayPages()
Dim GrpNameCurrent As Variant, GrpNamePrevious As Variant
Dim GrpPage As Integer, GrpPages As Integer
=============

5) Did you add a control to the Group Footer to display the page
numbers? Did you name it "ctlGrpPages"?

Best I can do for you with the information given.
Hope this helps.
Thanks for writing back. I've been sick and need some time to step through
what you wrote and make sure I have the correct coding. I've noticed one
difference in what you wrote and what is working in the first report I did.
You wrote to put the Event Procedure in the Group Footer Format event line
and it's code in the Group Footer Format Event sub. I have the Event
Procedure on the Page Footer Format event line, and the code in the
PageFooterSection Format Event sub. When I copied the code from the web
address, that is what happened. It was nothing intentional on my part. What
difference could this create? Thank you for your patience with me. I'm still
new to this.
 
fredg said:
I followed the thread started on 6/15/05 between sjkrause and fredg about
manually resetting page numbers. I used the code given there, and made the
appropriate corrections for my needs. The adjusted code worked correctly for
the first two reports I created, but it is not working for another report I
need in a different database. It is combining all the "groups" together
except the last one. Thus my page numbers are appearing Page 1 of 127, and
then Page 1 of 1. Am I doing something wrong with my grouping and sorting?
I've looked at everything very carefully but am beginning to think I'm
overlooking the obvious.

I am using Access 2000.

Articles from 6/15 are no longer on my computer.
If memory serves me, he was trying to print page 1 of 3, 2 of 3, etc.
for each group of records on a report, using code from
http://www.mvps.org/access/reports/rpt0013.htm

If it works for 2 reports, but not the 3rd, it is logical to assume
you have something in that 3rd report that is different.

Perhaps it is your Sorting and Grouping.
But I don't know what you are grouping on.

Things to check:
1) Did you add a control to the Page Footer to calculate pages
=[Pages]

2) Write [Event Procedure] on the Group Footer Format event line, and
then paste the code into the Format event Sub.

3) Did you change the line of code that reads:
GrpNameCurrent = Me!Salesperson
to
GrpNameCurrent = Me![Whatever field the Report is Grouped on]

4) Did you dim the appropriate variables in the Declaration's section
of the code:

Option Compare Database
Option Explicit

Dim GrpArrayPage(), GrpArrayPages()
Dim GrpNameCurrent As Variant, GrpNamePrevious As Variant
Dim GrpPage As Integer, GrpPages As Integer
=============

5) Did you add a control to the Group Footer to display the page
numbers? Did you name it "ctlGrpPages"?

Best I can do for you with the information given.
Hope this helps.
Thanks for writing back. I've been sick and need some time to step through
what you wrote and make sure I have the correct coding. I've noticed one
difference in what you wrote and what is working in the first report I did.
You wrote to put the Event Procedure in the Group Footer Format event line
and it's code in the Group Footer Format Event sub. I have the Event
Procedure on the Page Footer Format event line, and the code in the
PageFooterSection Format Event sub. When I copied the code from the web
address, that is what happened. It was nothing intentional on my part. What
difference could this create? Thank you for your patience with me. I'm still
new to this.

Regarding these lines ..
These are posting errors on my part.
2) Write [Event Procedure] on the Group Footer Format event line, and
then paste the code into the Format event Sub.
The above line should have referred to the Page Footer Format event
line, not the Group Footer Format event.
5) Did you add a control to the Group Footer to display the page
numbers? Did you name it "ctlGrpPages"?
The control "ctlGroupPates" does go into the Page Footer, not the
Group Footer.

Sorry to have confused you.
Working from memory is not a good thing. :-(
 
fredg said:
fredg said:
On Fri, 22 Jul 2005 15:37:02 -0700, Rebecca wrote:

I followed the thread started on 6/15/05 between sjkrause and fredg about
manually resetting page numbers. I used the code given there, and made the
appropriate corrections for my needs. The adjusted code worked correctly for
the first two reports I created, but it is not working for another report I
need in a different database. It is combining all the "groups" together
except the last one. Thus my page numbers are appearing Page 1 of 127, and
then Page 1 of 1. Am I doing something wrong with my grouping and sorting?
I've looked at everything very carefully but am beginning to think I'm
overlooking the obvious.

I am using Access 2000.

Articles from 6/15 are no longer on my computer.
If memory serves me, he was trying to print page 1 of 3, 2 of 3, etc.
for each group of records on a report, using code from
http://www.mvps.org/access/reports/rpt0013.htm

If it works for 2 reports, but not the 3rd, it is logical to assume
you have something in that 3rd report that is different.

Perhaps it is your Sorting and Grouping.
But I don't know what you are grouping on.

Things to check:
1) Did you add a control to the Page Footer to calculate pages
=[Pages]

2) Write [Event Procedure] on the Group Footer Format event line, and
then paste the code into the Format event Sub.

3) Did you change the line of code that reads:
GrpNameCurrent = Me!Salesperson
to
GrpNameCurrent = Me![Whatever field the Report is Grouped on]

4) Did you dim the appropriate variables in the Declaration's section
of the code:

Option Compare Database
Option Explicit

Dim GrpArrayPage(), GrpArrayPages()
Dim GrpNameCurrent As Variant, GrpNamePrevious As Variant
Dim GrpPage As Integer, GrpPages As Integer
=============

5) Did you add a control to the Group Footer to display the page
numbers? Did you name it "ctlGrpPages"?

Best I can do for you with the information given.
Hope this helps.
Thanks for writing back. I've been sick and need some time to step through
what you wrote and make sure I have the correct coding. I've noticed one
difference in what you wrote and what is working in the first report I did.
You wrote to put the Event Procedure in the Group Footer Format event line
and it's code in the Group Footer Format Event sub. I have the Event
Procedure on the Page Footer Format event line, and the code in the
PageFooterSection Format Event sub. When I copied the code from the web
address, that is what happened. It was nothing intentional on my part. What
difference could this create? Thank you for your patience with me. I'm still
new to this.

Regarding these lines ..
These are posting errors on my part.
2) Write [Event Procedure] on the Group Footer Format event line, and
then paste the code into the Format event Sub.
The above line should have referred to the Page Footer Format event
line, not the Group Footer Format event.
5) Did you add a control to the Group Footer to display the page
numbers? Did you name it "ctlGrpPages"?
The control "ctlGroupPates" does go into the Page Footer, not the
Group Footer.

Sorry to have confused you.
Working from memory is not a good thing. :-(
No worries about confusing me. I appreciate the time you took to work from
memory.

Well, I went over your check list carefully and then compared the working
code and non-working code again and couldn't find anything. I decided to try
creating a fresh report, and everything is working correctly now. I guess
something got corrupted. Thanks again for your help!
 
Back
Top