Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sum calculated form fields that use dlookup

Status
Not open for further replies.

emtenzer

MIS
Nov 14, 2001
50
US
I have a form that is keeping track of miscellaneous sales. The items first have to look up the cost of an item, then find out of there is sales tax on that item and add to it. So I have:

=([Quantity]*ItemKey.Column(2)) which is the cost of the item

=IIf(IsNull([ItemKey]),0,DLookUp("TaxRate","tblMiscellaneousItemsforSale","ItemID = " & [ItemKey])*[txtTotal]) which looks up if it is a taxable item

=[Quantity]*[ItemKey].[Column](4) which is the total of that item

I need to sum all items though and I can only get #Error. I am putting that text box in the form footer.

Any ideas? Thank you in advance.
 
Honestly, I've tried about everything. I've created extra text boxes to hold the values of the calculations. I've tried combining every single calculation with "Sum(...) What I have right now is: Sum([Quantity]*[ItemKey].[Column](4)).I'm currently looking into trying to make this form a split form and adding a totals row.
 
FYI you can not use the sum function on calculated controls.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top