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

Using sum() from subform in form

Status
Not open for further replies.

Paddya

Programmer
Apr 25, 2002
15
IE
Hi,

Ive created a report with a subreport inside it. I was wondering if it is possible to carry the sum of a column in the subform into the main form to use in calculations?

For example

Form
Date Desc Amt
-Details...

Total =sum(amt)

SubForm
Date Area Cost
-Details....


Report Footer
Grand Total =(sum(amt)+sum(cost))


Thanks for your time
Paddy :)
 
I have never tried that but have you tried to use the expression builder on the field and select you sum field from the subreport. As I said I have never tried it so let me know if it works.
 
Thanx for the idea, but tried that already and it doesnt work. When report is loaded it asks for the value of "Reports!subReport!Amt".

Thanx anyway,
Paddy :)
 
Darn. I was afraid of that. Ok. Next solution. Write a query that process the same data as you subreport. Next you would write a FUNCTION to retrieve the value you need from the query. The nice thing about a function is that this value can be accessed in the expression builder.

Let me know how it works. Can always come up with a different way if this one does not work.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top