Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sum in Report Page footer!!!

Status
Not open for further replies.

Fekri

Programmer
Jan 3, 2004
284
IR
Hi,

in my report, I have a Unbound text box in report footer and I have a calculation in report detail section which I will keep one field value to unbound text box and will add in each record. I will use the page sum in last page to continue adding new values in next pages.

every thing works well when the user will preview page by page. But if user jump from page 1 to page 10, the sum of page 1 will continue in start of page 10 and the between 9 page will not calculate!!!!

any idea to solve this problem???

Thanks
Ali

Thanks & Good Luck
Ali Fekri
 
I have 3 column in my report which in each group will continue to more than 50 pages.
So, I have to make sumurise in end of page and also say in the first of page the last page sumurise.
for example:

A B C
From Page 1 200 500 100
to ali 0 5 2
from ali 5 0 0
to sara 10 5 4
...
...
Page sum 215 510 106
page 2



From Page 2 215 510 106
to sali 55 12 4
from saba 0 16 48
...
...
Page sum 270 538 194
page 3


this is the example of 2 page,
First we have to sumurise the record of group which not yet completed.
second, we have to say in first of new page, what wa the sumurise the last page?

Thanks
Ali

Thanks & Good Luck
Ali Fekri
 
Thanks

But this site looks like down.
I couldn't access to this site!!!

Do you any other address of him?

Thanks
Ali


Thanks & Good Luck
Ali Fekri
 
I just tried the link and it worked for me.
From Allen Browne's page:
[blue]
Reports: Page Totals
Each section of a report has a Format event, where you can alter properties such as Visible, Color, Size, etc in a manner similar to the Current in a form. (See Runtime Properties: Forms for details.) For example to force a page break when certain conditions are met, include a PageBreak control in the Detail Section and toggle its Visible property. In addition, the Print event can be used to perform tasks like adding the current record to a running total.

You have an Amount field, and want to display the Amount total for that page in the Page Footer. Totals are not normally available in the Page Footer, but the task requires just four lines of code!

In the PageHeader's Format event procedure, add:
Code:
    curTotal = 0             'Reset the sum to zero each new Page.
In the DetailSection's Print event, add:
Code:
    If PrintCount = 1 Then curTotal = curTotal + Me.Amount
Place an unbound control called PageTotal in the Page Footer. In the PageFooter's Format, add:
Code:
    Me.PageTotal = curTotal
In the Code Window under Declarations enter:
Code:
    Option Explicit          'Optional, but recommended for every module.
    Dim curTotal As Currency 'Variable to sum [Amount] over a Page.
That's it!
[/blue]

Duane
Hook'D on Access
MS Access MVP
 
Thanks

I don't know why I couldn't open this link!!!

this method is working well until user preview page by page.
If user jump for example from page 1 to page 10:

The total page of page 1 will add on page 10 and in the end of page 10 will show sumurise page 1 and page 10. and all the page from 2 to 9 will not iclude of page 10 sumurise!!!!

how I should solve this problem??

Thanks for your advise
Ali


Thanks & Good Luck
Ali Fekri
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top