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!

totaling a calculated field on subform

Status
Not open for further replies.

dmatlock

Technical User
Aug 27, 2001
7
US
I have a subform (parts ordered) on the mainform (PO#). On the subform there is cost each and qty ordered. I have a unbound control (extended cost) with cost each*Qty ordered on the subform. Works great until I try to add all the extended costs together. I can sum the cost each or the quantity, but I can't sum the extended cost. I have tried doing this on the subform footer and from the main form.

My approach has been to build an expression going to open forms and selecting the sum of the value of that box. Again, it works for fields from the table, but not the control box on the form.

I have even tried to do a query but that was pretty messy. I started with a field called extended cost in the table, but wasn't able to make it update automatically. That would probably be the right way to do this. Any suggestions would be greatly appreciated.

thanks......
 
Try the following in the Control Source of an unbound Text control in the subform footer:
Code:
=Sum([CostEach]*[Qty])
 
P.S. I forgot to mention that you can't use a calculated control with aggregate functions, like Sum. See the Access online help for "Sum" for additional details.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top