Pg Numbers Per Group

C

Connie

I have created an Invoice that is grouped by stores & each starts a new
page. Sometimes a store can have multiple pages. What I'd like to do is
print at bottom of page "Page _ Of _". I can get the page to reset to 1
(sometimes - see below), but I can't get the total count of pages per group
.... it shows the total number of pages in the entire report.

I should note that I tried using the code Printing First and Last Page
Numbers for Report Groups from www.mvps.org/access but that doesn't seem to
work. The line of code that states "If Me.Pages=0 then" is always 0 & it
does not seem to make 2 passes as stated. So when I run the report nothing
prints. I tried modifying the code & I was able to make the 1st 3 pages
(out of 4) correct. The following is what happens with my modifications:

Page 1 is Store A (only 1 page) so it prints Page 1 Of 1
Pg 2 & 3 is Store B it prints Page 1 Of 2 & Page 2 Of 2
Page 4 is Store C (only 1 page) it prints Page 3 Of 3

I feel like I'm so close, but darned if I can get it working completely. If
you need to know my modifications I'll post them, however, 1 thing I did was
put the code in the PageFooterSection OnPrint instead of OnFormat & removed
the If then Else for Me.Pages=0.

Please help as I have put way too many hrs into this & am totally
frustrated! :(
TIA
Connie
 
C

Cheryl Fischer

Connie,

The key to making this work is that you need two controls in your page
footer:

The first should be named ctlGrpPages and should be Visible. It will hold
the Page x of x for the group. The second should be a textbox control,
name is unimportant and it can be invisible. Its Control Source should be:
=[Pages]

Setup in this way, the original code from the Access Web that you were using
will work as it should.
 
C

Connie

THANK YOU, THANK YOU, THANK YOU!!!

I can't believe I didn't see that ... I had the ctlGrpPages but not the
txtbox with ControlSource=Pages. Wow, just 1 little textbox could have
saved me sooo much time.

Thanks so much Cheryl
Connie

Cheryl Fischer said:
Connie,

The key to making this work is that you need two controls in your page
footer:

The first should be named ctlGrpPages and should be Visible. It will hold
the Page x of x for the group. The second should be a textbox control,
name is unimportant and it can be invisible. Its Control Source should be:
=[Pages]

Setup in this way, the original code from the Access Web that you were using
will work as it should.


--

Cheryl Fischer, MVP Microsoft Access
Law/Sys Associates, Houston, TX


Connie said:
I have created an Invoice that is grouped by stores & each starts a new
page. Sometimes a store can have multiple pages. What I'd like to do is
print at bottom of page "Page _ Of _". I can get the page to reset to 1
(sometimes - see below), but I can't get the total count of pages per group
... it shows the total number of pages in the entire report.

I should note that I tried using the code Printing First and Last Page
Numbers for Report Groups from www.mvps.org/access but that doesn't seem to
work. The line of code that states "If Me.Pages=0 then" is always 0 & it
does not seem to make 2 passes as stated. So when I run the report nothing
prints. I tried modifying the code & I was able to make the 1st 3 pages
(out of 4) correct. The following is what happens with my modifications:

Page 1 is Store A (only 1 page) so it prints Page 1 Of 1
Pg 2 & 3 is Store B it prints Page 1 Of 2 & Page 2 Of 2
Page 4 is Store C (only 1 page) it prints Page 3 Of 3

I feel like I'm so close, but darned if I can get it working completely. If
you need to know my modifications I'll post them, however, 1 thing I did was
put the code in the PageFooterSection OnPrint instead of OnFormat & removed
the If then Else for Me.Pages=0.

Please help as I have put way too many hrs into this & am totally
frustrated! :(
TIA
Connie
 

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