Page number in footer by group

P

pgarcia

Hello all,
I’m trying to put page numbers (1 of 2 pages) in the footer but by group.
I’ve tried the VB code that I have seen in other forms but I’m not able to
make it work. Does anyone know of an easier ways to set this up or can I
email my db?

And yes, I have used this linke, it's just not working for me.
http://www.mvps.org/access/reports/rpt0013.htm
 
B

BruceM

Unfortunately, there is no easier way I know of (unless Access 2007 has
something). State in what way it does not work, and post the code you are
using.
 
B

Bob Quintal

Thanks Bruce.

I'm using the VB code for here:
http://www.mvps.org/access/reports/rpt0013.htm I've change
"Saleman" to "AcctNo" as that is my group name. All it does is
desplayes "ctlGrpPages" and not the page numbers. Am I missing
somthing?
Things to check
1) did you create "ctlGrpPages" as a label or a textbox? should be
textbox
2) you put "ctlGrpPages" in the Textbox's caption property instead of
the name property.?
3) you put "ctlGrpPages" in the Textbox's controlsource property
instead of the name property.?


Q
 
B

BruceM

In addition to what Bob wrote, did you create ctlGrpPages at all? It is the
second note at the bottom of the web page, just below the code. Note that
ctlGrpPages can be another name as long as you change it in the code and
apply the name to the text box, but in any case it needs to be there.
 
P

pgarcia

Ok, so I have changed the "GrpNameCurrent = Me!Salesman" to "GrpNameCurrent =
Me!AcctNo". I created a text box using "ab" and not "Ab". Deleted the label
and only the text box is there. I go to "Other" tab and put "ctlGrpPages" as
the name (I've also tried Me!ctlGrpPages). But when I run/view the report,
it's blank. I must be missing something and what that is, I'm not sure. The
instruction a very easy. It must be something in the name or setup of the
report.

Could I email to you?
 
B

BruceM

If you don't use the code, do you get any records for the report? If
Comment Block and Uncomment Block is on the Edit menu, select the code and
click Edit >> Comment Block. If it's not on the edit menu, right click
anywhere on the VBA editor tool bar, and select Customize. Click the
Commands tab, then click Edit on the Left. On the right locate Comment
Block and Uncomment Block, and drag them to the toolbar. Click Close,
Select the code, and click the Comment Block icon. This places an
apostrophe at the front of the code, which causes Access to ignore it.

After disabling the code, try to run the report. If you don't get any
records the problem is not the page numbering code. If you can run the
report and see the expected information, uncomment the code and verify the
following:

1) AcctNo is the name of the text box bound to the field on which you are
grouping. If the field and the text box have the same name, try changing
the name of the text box to something like txtAcctNo, and change the line of
code accordingly.

2) ctlGrpPages is the name of a text box on the report, and is in the code.
The text box ctlGrpPages does not have a Control Source.

I don't know what you mean by:
created a text box using "ab" and not "Ab"
 
P

pgarcia

Sorry for my ignorance, but I can’t seem to make this work. I can run the
report with or without the VB code in it. The AcctNo field and text box do
have different names and have put ctlGrpPages as the name of the text box and
there is nothing in the Control Source, it’s blank. Will, thanks any way. It
would have been nice to have page numbers but this is take up to much time.
 
B

BruceM

For reasons that are at the moment unclear to me I added a hidden text box
to the same footer as ctlGrpPages. The Control Source is set to =[Pages].
Without the text box the numbering does not work, but I do now know why. I
will investigate further.
 
D

Douglas J. Steele

I don't believe Access keeps track of the page numbers unless you're using
the variable [Page] or [Pages] somewhere in the report.

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


BruceM said:
For reasons that are at the moment unclear to me I added a hidden text box
to the same footer as ctlGrpPages. The Control Source is set to =[Pages].
Without the text box the numbering does not work, but I do now know why.
I will investigate further.

pgarcia said:
Sorry for my ignorance, but I can't seem to make this work. I can run the
report with or without the VB code in it. The AcctNo field and text box
do
have different names and have put ctlGrpPages as the name of the text box
and
there is nothing in the Control Source, it's blank. Will, thanks any way.
It
would have been nice to have page numbers but this is take up to much
time.
 
P

pgarcia

How do you mean? Were should the page or pages go?

Douglas J. Steele said:
I don't believe Access keeps track of the page numbers unless you're using
the variable [Page] or [Pages] somewhere in the report.

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


BruceM said:
For reasons that are at the moment unclear to me I added a hidden text box
to the same footer as ctlGrpPages. The Control Source is set to =[Pages].
Without the text box the numbering does not work, but I do now know why.
I will investigate further.

pgarcia said:
Sorry for my ignorance, but I can't seem to make this work. I can run the
report with or without the VB code in it. The AcctNo field and text box
do
have different names and have put ctlGrpPages as the name of the text box
and
there is nothing in the Control Source, it's blank. Will, thanks any way.
It
would have been nice to have page numbers but this is take up to much
time.

:

If you don't use the code, do you get any records for the report? If
Comment Block and Uncomment Block is on the Edit menu, select the code
and
click Edit >> Comment Block. If it's not on the edit menu, right click
anywhere on the VBA editor tool bar, and select Customize. Click the
Commands tab, then click Edit on the Left. On the right locate Comment
Block and Uncomment Block, and drag them to the toolbar. Click Close,
Select the code, and click the Comment Block icon. This places an
apostrophe at the front of the code, which causes Access to ignore it.

After disabling the code, try to run the report. If you don't get any
records the problem is not the page numbering code. If you can run the
report and see the expected information, uncomment the code and verify
the
following:

1) AcctNo is the name of the text box bound to the field on which you
are
grouping. If the field and the text box have the same name, try
changing
the name of the text box to something like txtAcctNo, and change the
line of
code accordingly.

2) ctlGrpPages is the name of a text box on the report, and is in the
code.
The text box ctlGrpPages does not have a Control Source.

I don't know what you mean by:
created a text box using "ab" and not "Ab"

Ok, so I have changed the "GrpNameCurrent = Me!Salesman" to
"GrpNameCurrent =
Me!AcctNo". I created a text box using "ab" and not "Ab". Deleted the
label
and only the text box is there. I go to "Other" tab and put
"ctlGrpPages"
as
the name (I've also tried Me!ctlGrpPages). But when I run/view the
report,
it's blank. I must be missing something and what that is, I'm not
sure.
The
instruction a very easy. It must be something in the name or setup of
the
report.

Could I email to you?


:

in
Thanks Bruce.

I'm using the VB code for here:
http://www.mvps.org/access/reports/rpt0013.htm I've change
"Saleman" to "AcctNo" as that is my group name. All it does is
desplayes "ctlGrpPages" and not the page numbers. Am I missing
somthing?

Things to check
1) did you create "ctlGrpPages" as a label or a textbox? should be
textbox
2) you put "ctlGrpPages" in the Textbox's caption property instead of
the name property.?
3) you put "ctlGrpPages" in the Textbox's controlsource property
instead of the name property.?


Q




:

Unfortunately, there is no easier way I know of (unless Access
2007 has something). State in what way it does not work, and
post the code you are using.


Hello all,
I'm trying to put page numbers (1 of 2 pages) in the footer but
by group. I've tried the VB code that I have seen in other
forms but I'm not able to make it work. Does anyone know of an
easier ways to set this up or can I email my db?

And yes, I have used this linke, it's just not working for me.
http://www.mvps.org/access/reports/rpt0013.htm
 
B

BruceM

Add a text box to the footer. Set its Control Source to =[Pages] and its
Visible property to False. Try the code again.

pgarcia said:
How do you mean? Were should the page or pages go?

Douglas J. Steele said:
I don't believe Access keeps track of the page numbers unless you're
using
the variable [Page] or [Pages] somewhere in the report.

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


BruceM said:
For reasons that are at the moment unclear to me I added a hidden text
box
to the same footer as ctlGrpPages. The Control Source is set to
=[Pages].
Without the text box the numbering does not work, but I do now know
why.
I will investigate further.

Sorry for my ignorance, but I can't seem to make this work. I can run
the
report with or without the VB code in it. The AcctNo field and text
box
do
have different names and have put ctlGrpPages as the name of the text
box
and
there is nothing in the Control Source, it's blank. Will, thanks any
way.
It
would have been nice to have page numbers but this is take up to much
time.

:

If you don't use the code, do you get any records for the report? If
Comment Block and Uncomment Block is on the Edit menu, select the
code
and
click Edit >> Comment Block. If it's not on the edit menu, right
click
anywhere on the VBA editor tool bar, and select Customize. Click the
Commands tab, then click Edit on the Left. On the right locate
Comment
Block and Uncomment Block, and drag them to the toolbar. Click
Close,
Select the code, and click the Comment Block icon. This places an
apostrophe at the front of the code, which causes Access to ignore
it.

After disabling the code, try to run the report. If you don't get
any
records the problem is not the page numbering code. If you can run
the
report and see the expected information, uncomment the code and
verify
the
following:

1) AcctNo is the name of the text box bound to the field on which you
are
grouping. If the field and the text box have the same name, try
changing
the name of the text box to something like txtAcctNo, and change the
line of
code accordingly.

2) ctlGrpPages is the name of a text box on the report, and is in the
code.
The text box ctlGrpPages does not have a Control Source.

I don't know what you mean by:
created a text box using "ab" and not "Ab"

Ok, so I have changed the "GrpNameCurrent = Me!Salesman" to
"GrpNameCurrent =
Me!AcctNo". I created a text box using "ab" and not "Ab". Deleted
the
label
and only the text box is there. I go to "Other" tab and put
"ctlGrpPages"
as
the name (I've also tried Me!ctlGrpPages). But when I run/view the
report,
it's blank. I must be missing something and what that is, I'm not
sure.
The
instruction a very easy. It must be something in the name or setup
of
the
report.

Could I email to you?


:

in
Thanks Bruce.

I'm using the VB code for here:
http://www.mvps.org/access/reports/rpt0013.htm I've change
"Saleman" to "AcctNo" as that is my group name. All it does is
desplayes "ctlGrpPages" and not the page numbers. Am I missing
somthing?

Things to check
1) did you create "ctlGrpPages" as a label or a textbox? should be
textbox
2) you put "ctlGrpPages" in the Textbox's caption property instead
of
the name property.?
3) you put "ctlGrpPages" in the Textbox's controlsource property
instead of the name property.?


Q




:

Unfortunately, there is no easier way I know of (unless Access
2007 has something). State in what way it does not work, and
post the code you are using.


Hello all,
I'm trying to put page numbers (1 of 2 pages) in the footer
but
by group. I've tried the VB code that I have seen in other
forms but I'm not able to make it work. Does anyone know of
an
easier ways to set this up or can I email my db?

And yes, I have used this linke, it's just not working for
me.
http://www.mvps.org/access/reports/rpt0013.htm
 

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