A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Setting Up & Running Reports
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Group page numbering



 
 
Thread Tools Display Modes
  #1  
Old May 24th, 2004, 11:09 AM
Leslie Isaacs
external usenet poster
 
Posts: n/a
Default Group page numbering

Hello All

I have a report with group [staffname] header and footer, and have forced a
new page after each [staffname] footer section. I need to print the page
number for each page within a group - starting from 1 on the first page of
each group. So, if the first group has 3 pages, and the second group has 4
pages and the third group has 2 pages, the page numbering of the report
needs to be 1,2,3,1,2,3,4,1,2.

I'm sure this can be done but I can't see how - hope someone can help.

Many thanks
Leslie Isaacs


  #2  
Old May 24th, 2004, 01:50 PM
Cheryl Fischer
external usenet poster
 
Posts: n/a
Default Group page numbering

Leslie,

There is code here that will number pages within a report grouping.

http://www.mvps.org/access/reports/rpt0013.htm

The key to making this work is:

Have TWO textbox controls in the PageFooter of the report

a. One textbox named: ctlGrpPages No other properties set

b. One textbox named: any other name you wish

ControlSource property set to: =[Pages] Visible set to 'No'


hth,
--

Cheryl Fischer, MVP Microsoft Access



"Leslie Isaacs" wrote in message
...
Hello All

I have a report with group [staffname] header and footer, and have forced

a
new page after each [staffname] footer section. I need to print the page
number for each page within a group - starting from 1 on the first page of
each group. So, if the first group has 3 pages, and the second group has 4
pages and the third group has 2 pages, the page numbering of the report
needs to be 1,2,3,1,2,3,4,1,2.

I'm sure this can be done but I can't see how - hope someone can help.

Many thanks
Leslie Isaacs




  #3  
Old May 24th, 2004, 04:12 PM
Leslie Isaacs
external usenet poster
 
Posts: n/a
Default Group page numbering

Hello Cheryl

Thanks for your reply.

I must be a bit thick, because I can't get the code to work!

I did as you said with the two text boxes in the PageFooter section, but
when the notes at http://www.mvps.org/access/reports/rpt0013.htm say "Open
any report in design view and open its Code-Behind-Reports module.", I
wasn't sure what this means, but I pasted the code into the form's On Open
event: is this right? I noticed that the code includes the line:

Private Sub PageFooter_Format(Cancel As Integer, FormatCount As Integer)

Does this mean the code should be pasted as the PageFooter On Format event
procedure?
When I tried to do this, the procedure came up with the line:

Private Sub PageFooterSection_Format(Cancel As Integer, FormatCount As
Integer)
which is not quite the same as above.

You can see I'm getting a bit lost here!
Possibly the problem is connected to the fact that the name of my 'group' is
[actualjobdesc stafname]. As per the instruction I changed the line

GrpNameCurrent = Me!Salesperson
to
GrpNameCurrent = Me!actualjobdesc stafname
then to
GrpNameCurrent = [Me]![actualjobdesc stafname]
then to
GrpNameCurrent = Me!actualjobdescstafname
(having changed the field anme to [actualjobdescstafname] in the report's
underlying query)

None of these worked!
Where have I gone wrong?

Thanks for your continued help.
Les


"Cheryl Fischer" wrote in message
...
Leslie,

There is code here that will number pages within a report grouping.

http://www.mvps.org/access/reports/rpt0013.htm

The key to making this work is:

Have TWO textbox controls in the PageFooter of the report

a. One textbox named: ctlGrpPages No other properties set

b. One textbox named: any other name you wish

ControlSource property set to: =[Pages] Visible set to

'No'


hth,
--

Cheryl Fischer, MVP Microsoft Access



"Leslie Isaacs" wrote in message
...
Hello All

I have a report with group [staffname] header and footer, and have

forced
a
new page after each [staffname] footer section. I need to print the page
number for each page within a group - starting from 1 on the first page

of
each group. So, if the first group has 3 pages, and the second group has

4
pages and the third group has 2 pages, the page numbering of the report
needs to be 1,2,3,1,2,3,4,1,2.

I'm sure this can be done but I can't see how - hope someone can help.

Many thanks
Leslie Isaacs






  #4  
Old May 24th, 2004, 04:58 PM
Cheryl Fischer
external usenet poster
 
Posts: n/a
Default Group page numbering

Leslie,

wasn't sure what this means, but I pasted the code into the form's On Open
event: is this right?


No, the code should not be put into the Open event of the report.

The following line is correct and, yes, the code goes into the Page Footer's
"On Format" event.

Private Sub PageFooterSection_Format(Cancel As Integer, FormatCount As
Integer)

The Private Sub .... header found in the code is likely related to the
version for which it was originally written - use what your version of
Access uses.

As to your group names, the following is probably a good idea.

GrpNameCurrent = Me!actualjobdescstafname
(having changed the field anme to [actualjobdescstafname] in the

report's
underlying query)


Now, when you say nothing works, that doesn't provide much to go on. Are
you receiving an error message? If so, what is it and what line in the code
produces it?

Is there any *other* code behind the report which you were using in an
attempt to paginate by groups? If so, comment it out.

--

Cheryl Fischer, MVP Microsoft Access



"Leslie Isaacs" wrote in message
...
Hello Cheryl

Thanks for your reply.

I must be a bit thick, because I can't get the code to work!

I did as you said with the two text boxes in the PageFooter section, but
when the notes at http://www.mvps.org/access/reports/rpt0013.htm say "Open
any report in design view and open its Code-Behind-Reports module.", I
wasn't sure what this means, but I pasted the code into the form's On Open
event: is this right? I noticed that the code includes the line:

Private Sub PageFooter_Format(Cancel As Integer, FormatCount As Integer)

Does this mean the code should be pasted as the PageFooter On Format event
procedure?
When I tried to do this, the procedure came up with the line:

Private Sub PageFooterSection_Format(Cancel As Integer, FormatCount As
Integer)
which is not quite the same as above.

You can see I'm getting a bit lost here!
Possibly the problem is connected to the fact that the name of my 'group'

is
[actualjobdesc stafname]. As per the instruction I changed the line

GrpNameCurrent = Me!Salesperson
to
GrpNameCurrent = Me!actualjobdesc stafname
then to
GrpNameCurrent = [Me]![actualjobdesc stafname]
then to
GrpNameCurrent = Me!actualjobdescstafname
(having changed the field anme to [actualjobdescstafname] in the report's
underlying query)

None of these worked!
Where have I gone wrong?

Thanks for your continued help.
Les


"Cheryl Fischer" wrote in message
...
Leslie,

There is code here that will number pages within a report grouping.

http://www.mvps.org/access/reports/rpt0013.htm

The key to making this work is:

Have TWO textbox controls in the PageFooter of the report

a. One textbox named: ctlGrpPages No other properties set

b. One textbox named: any other name you wish

ControlSource property set to: =[Pages] Visible set to

'No'


hth,
--

Cheryl Fischer, MVP Microsoft Access



"Leslie Isaacs" wrote in message
...
Hello All

I have a report with group [staffname] header and footer, and have

forced
a
new page after each [staffname] footer section. I need to print the

page
number for each page within a group - starting from 1 on the first

page
of
each group. So, if the first group has 3 pages, and the second group

has
4
pages and the third group has 2 pages, the page numbering of the

report
needs to be 1,2,3,1,2,3,4,1,2.

I'm sure this can be done but I can't see how - hope someone can help.

Many thanks
Leslie Isaacs








  #5  
Old May 28th, 2004, 12:58 PM
Bruce
external usenet poster
 
Posts: n/a
Default Group page numbering

I could not get the code to work either, so I went back to
searching newsgroups, where I found this thread. I had
just opened a code window and pasted the code, and it fell
in place as it should, with the code being in two
sections. The second section started with Private Sub
PageFooter_Format...etc. The problem was that it needed
to be Private Sub PageFooterSection_Format...etc. The
other point is that the supplied code seems to be based on
the assumption that the report is grouped by Salesperson,
and that there is a control (text box) named Salesperson
in the group header (or footer). In my case my report
(which is based on a query) is grouped by FullName. The
text box containing that field is txtFullName. At first I
was using Me!FullName in place of Me!Salesperson. As soon
as I changed it to Me!txtFullName, and changed PageFooter
to PageFooterSection as described above, it worked. Your
exchange on this subject was very timely.
-----Original Message-----
Leslie,

wasn't sure what this means, but I pasted the code into

the form's On Open
event: is this right?


No, the code should not be put into the Open event of the

report.

The following line is correct and, yes, the code goes

into the Page Footer's
"On Format" event.

Private Sub PageFooterSection_Format(Cancel As

Integer, FormatCount As
Integer)

The Private Sub .... header found in the code is likely

related to the
version for which it was originally written - use what

your version of
Access uses.

As to your group names, the following is probably a good

idea.

GrpNameCurrent = Me!actualjobdescstafname
(having changed the field anme to

[actualjobdescstafname] in the
report's
underlying query)


Now, when you say nothing works, that doesn't provide

much to go on. Are
you receiving an error message? If so, what is it and

what line in the code
produces it?

Is there any *other* code behind the report which you

were using in an
attempt to paginate by groups? If so, comment it out.

--

Cheryl Fischer, MVP Microsoft Access



"Leslie Isaacs" wrote in

message
...
Hello Cheryl

Thanks for your reply.

I must be a bit thick, because I can't get the code to

work!

I did as you said with the two text boxes in the

PageFooter section, but
when the notes at

http://www.mvps.org/access/reports/rpt0013.htm say "Open
any report in design view and open its Code-Behind-

Reports module.", I
wasn't sure what this means, but I pasted the code into

the form's On Open
event: is this right? I noticed that the code includes

the line:

Private Sub PageFooter_Format(Cancel As Integer,

FormatCount As Integer)

Does this mean the code should be pasted as the

PageFooter On Format event
procedure?
When I tried to do this, the procedure came up with the

line:

Private Sub PageFooterSection_Format(Cancel As Integer,

FormatCount As
Integer)
which is not quite the same as above.

You can see I'm getting a bit lost here!
Possibly the problem is connected to the fact that the

name of my 'group'
is
[actualjobdesc stafname]. As per the instruction I

changed the line

GrpNameCurrent = Me!Salesperson
to
GrpNameCurrent = Me!actualjobdesc stafname
then to
GrpNameCurrent = [Me]![actualjobdesc stafname]
then to
GrpNameCurrent = Me!actualjobdescstafname
(having changed the field anme to

[actualjobdescstafname] in the report's
underlying query)

None of these worked!
Where have I gone wrong?

Thanks for your continued help.
Les


"Cheryl Fischer" wrote in

message
...
Leslie,

There is code here that will number pages within a

report grouping.

http://www.mvps.org/access/reports/rpt0013.htm

The key to making this work is:

Have TWO textbox controls in the PageFooter of

the report

a. One textbox named: ctlGrpPages No

other properties set

b. One textbox named: any other name you

wish

ControlSource property set to: =

[Pages] Visible set to
'No'


hth,
--

Cheryl Fischer, MVP Microsoft Access



"Leslie Isaacs"

wrote in message
...
Hello All

I have a report with group [staffname] header and

footer, and have
forced
a
new page after each [staffname] footer section. I

need to print the
page
number for each page within a group - starting from

1 on the first
page
of
each group. So, if the first group has 3 pages, and

the second group
has
4
pages and the third group has 2 pages, the page

numbering of the
report
needs to be 1,2,3,1,2,3,4,1,2.

I'm sure this can be done but I can't see how -

hope someone can help.

Many thanks
Leslie Isaacs








.

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 02:27 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.