calculated sum in subform footer problem

M

Mary Fran

Hi! I would like to sum [Price]*[Qty] in the footer of my subform and the
problem is that [Price] is an unbound field with a Dlookup function in its
control source. (Actual source is:
=IIf([Type]="Material",DLookUp("[Price]","qryCurrentMaterial","[MaterialID]="
&
[Item]),IIf([Type]="Hardware",DLookUp("[Price]","qryCurrentHardware","[HardwareID]=" & [Item]),DLookUp("[Price]","qryCurrentLabor","[Location]=" & [Item])))

Can someone tell me how to achieve this as sum([Price]*[Qty]) gives #Error.
Thanks!
 
N

NetworkTrade

well - no one else has replied in 3 days so I'll just point out that
sum([Price]*[Qty]) does not appear mathmatically possible....

you have a series of sums , each with a qty.... can't sum discrete fields

you need a Total per record.... i.e. Total=Price*Qty

and then Sum(Total)
 

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