Calculate total in Subfrom

P

Penstar

I am putting a control in the footer of my subform as follows:
=Sum([sale])

Which relates to a calculated field in my subform, details as follows:
Control Name "Sale"
Control Source
"=IIf([qty]>0,DLookUp("TotalMatCost","QuoteDetailCostQuery","QuoteDetailID="
& [Detailid])*([margin]+1)+[labourrate],0)

I can't understand why it won't add these values and I get a #Error.
 
K

KARL DEWEY

You have to use the full calculation instead of object name.
=Sum(IIf([qty]>0,DLookU("TotalMatCost",
"QuoteDetailCostQuery","QuoteDetailID=" &
[Detailid])*([margin]+1)+[labourrate],0))
 

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