calculation from sub form on main form

  • Thread starter Thread starter Valerie
  • Start date Start date
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?
 
-----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
 
Back
Top