calculation from sub form on main form

V

Valerie

I'm having trouble building an expression that works.
Here's my scenario:
Purchase Order form
Purchase Order subform - separate line items for each
part ordered, cost, units ordered, total cost
Now I want to create, in the Purchase Order form, a
calculated field to add up all the line item total costs.
I tried to use this expression:
=Sum([frmPurchaseOrdersSub].Form![Total Cost])
It accepted the expression, but then it gives me #Error
in the box. I have set the format as currency, and my
line item totals work just fine.
What am I doing wrong?
 
G

Guest

-----Original Message-----
I'm having trouble building an expression that works.
Here's my scenario:
Purchase Order form
Purchase Order subform - separate line items for each
part ordered, cost, units ordered, total cost
Now I want to create, in the Purchase Order form, a
calculated field to add up all the line item total costs.
I tried to use this expression:
=Sum([frmPurchaseOrdersSub].Form![Total Cost])
It accepted the expression, but then it gives me #Error
in the box. I have set the format as currency, and my
line item totals work just fine.
What am I doing wrong?

Place an invisible summary control, say txtSumofTotalCost,
in the subform footer with Control Source set to:

=Sum([Total Cost])

Refer to it in your main form control source:
=frmPurchaseOrdersSub.Form!txtSumofTotalCost

Kevin Sprinkel
Becker & Frondorf
 

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