I am using a DSum function on a form control to provide a Subtotal from a query. It works perfectly except that when I go to a new record in the subform I get #error in the Subtotal. As soon as I type anything...a space, letter, etc. the subtotal calculated correctly.
I would like the subtotal to update and continue showing the correct value after each item is added to the order details subform, and not show error before the next item is entered. I have been playing around with events and if dirty, etc with no luck.
Here is the expression used in the control source for the unbound textbook Subtotal:
=DSum('Price","GFQ1","fkOrderID = " & [fkOrderID] & "And fkOrderID =" & [fkOrderID])
GFQ1 is a query made for the purposes of calculations. My UnitPrice is a calculated field also using a Dmin and Iff function, so I can't use a simpler way to get the subtotal because of the limitation of summing a calculated field.
Any help is greatly appreciated!