Help with Total on last page of report

  • Thread starter mastermars via AccessMonster.com
  • Start date
M

mastermars via AccessMonster.com

Hello, I could really use some help as I have been pulling my hair out on
this one.
I have invoice created in reports and I am trying to print the total on the
last page of the invoice from the page footer.
This is what I have in the page footer
Sub total
VAT
Total

I added a text box in the page footer and put the following in =[Page] &
" of " & [Pages]

I set the cells I wanted on the last page only to visible=no

Then in the page footer property settings, under –Event –on format I have the
following code:
---------------------------------------------------

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

If [Page] = [Pages] Then
[Total].Visible = True

End If

End Sub

What am I doing wrong?

Many thanks
Sean
 
D

Duane Hookom

"What am I doing wrong?" You haven't stated any problem? What is happening or
not that doesn't meet your expectations?
 
M

Marshall Barton

mastermars said:
Hello, I could really use some help as I have been pulling my hair out on
this one.
I have invoice created in reports and I am trying to print the total on the
last page of the invoice from the page footer.
This is what I have in the page footer
Sub total
VAT
Total

I added a text box in the page footer and put the following in =[Page] &
" of " & [Pages]

I set the cells I wanted on the last page only to visible=no

Then in the page footer property settings, under –Event –on format I have the
following code:
---------------------------------------------------

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

If [Page] = [Pages] Then
[Total].Visible = True

End If

End Sub


By itself, that code is fine. What is the problem that
caused you to post this question.

Just guessing now, but the problem may be that the subtotal
and/or total text box expression is =Sum(something). If
that's the case, it won't work because the aggregate
functions (Count Sum, etc) do not mean anything in a page
header/footer section. That kibd of calculation should be
in the report footer and, if desired, the page footer can
refer to the report footer text boxes.
 
M

mastermars via AccessMonster.com

Sorry forgot to state my problem.

The problem is that the total is not appearing on the last page
 
D

Duane Hookom

What is the control source of the Total text box? If you set its Border to
solid red, do you see the outline on the last page?

Did you undersand Marsh's comments?
 
M

mastermars via AccessMonster.com

Hello,

I placed a red boarder around the total and this did not show on the last
page.
This is what I have on the Pager footer:

Sub total: =[sum exchange]+[profit]
Vat: =[sub]/100*17.5
Total: =[sub]+[roam]

Page: =[Page] & " of " & [Pages]

It all works fine apart from just displaying the total on the last page.

Do I need to do any thing with the Page cell, all I did to create this was
add a text box and type the =[Page] & " of " & [Pages] into the cell box.

Thanks
Sean
 
D

Duane Hookom

If this is a Page footer, what makes you think there will be values in the
text boxes? Are you using running sums or referencing controls from the
report footer section?

What happens if you change the code to flip the expression or use
Debug.Print to see if the code is running?
 

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