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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sum

Status
Not open for further replies.

Cia2a

Technical User
Aug 8, 2000
23
0
0
US
I have four fields in a db, Payment amount1, Payment Amount2, 3 ,and 4, they
are currenty fields.
On my report I will have ten or more records on a page. How can I have get a
grand total of all these fields for each record on a report in the report footer
 
Cia2a, Add a text box ([Text1] here) to the the detail section of your report. Use the 'Detail_Format' event procedure assigning its' value, thus;

Sub Detail_Format

Me![Text1] = Val([Payment amount1]+ Val([Payment Amount2]) + Val([Payment amount3]+ Val([Payment Amount4])

End Sub

Create the page total like this.

1.Create a text box in the page footer name it 'txtPageTotal'.

2. In the page PageHeader_Format() event' add the code

Sub PageHeader_Format()
Me!txtPageTotal = 0
End Sub

3. In the Detail_Print event add the lines

Sub Detail_Print
Me!txtPageTotal = Me!txtPageTotal + Nz(Me![Text1])
End Sub

This generates totals for the fields in each record for each page.

Problems? Let me know.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top