Showing a SUM from a subform

  • Thread starter Thread starter sajohn52
  • Start date Start date
S

sajohn52

I have a form called 'tblSales' which has a sub form named
'tblSalesDtls'. The subform is made up of three
fields the 'price' field, the 'qty' field and the
'total_price' field which is = 'price' * 'qty'. In the tblSales form I
want to display the total sum of the 'total_price' field for a Slaes
Order. I've tried using the following formulas but I just keep getting
error message:

=Sum([tblSalesDtls].[Form]![total_price])

=Sum(Forms![tblSales]![tblSalesDtls].[Form]![total_price])

Can someone tell me what I'm doing wrong?

TIA

Steffen


sajohn52
 
sajohn52 said:
I have a form called 'tblSales' which has a sub form named
'tblSalesDtls'. The subform is made up of three
fields the 'price' field, the 'qty' field and the
'total_price' field which is = 'price' * 'qty'. In the tblSales form I
want to display the total sum of the 'total_price' field for a Slaes
Order.

Make sure the subform has a form footer section, then add a
text box named txtGrandTotal with the expression:
=Sum(price * qty)

Then, back in the main form text box use the expression:
=tblSalesDtls.Form.txtGrandTotal
 
Marshall said:
Make sure the subform has a form footer section, then add a
text box named txtGrandTotal with the expression:
=Sum(price * qty)

Then, back in the main form text box use the expression:
=tblSalesDtls.Form.txtGrandTotal

Thanks for the response. I saw this solution in the Access manual. M
question really is why can't I just do the summation from the mai
form

sajohn5
 
sajohn52 said:
Thanks for the response. I saw this solution in the Access manual. My
question really is why can't I just do the summation from the main
form?


Because the data is in the subreport, it's just not
available to the main report.
 
Back
Top