| Van T. Dinh wrote:
| > DS
| >
| > I am not sure from your posts.
| >
| > If you look in Access VB Help, all 3 arguments of DSUM are Strings (3rd
| > argument is optional). In the Dsum expression you posted, 2 out of 3 are
| > not even Strings.
| >
| > Perhaps, you re-typed incorrectly on the post. It may be better to use Copy
| > & Paste. This way, we know exactly what you used in your database.
| >
| > In the 3rd argument of your DSum expression (and assuming that we have
| > sorted out the String problem above), the 2 instances of "[Order ID]" refer
| > to 2 different things. The one on the left refers to the Field in your
| > Query "[Mods Detail Query]". The one on the right refers to a specific
| > value (in a Control?). Can you explain where this value comes from, plse?
| >
| Thanks for the Posts, wold of answered sooner but after 14 hours, I need
| some sleep!
|
| =IIf(IsNull([Mod Price]),0,DSum([Mod Price],"Mods Detail Query",[Order
| ID]=[Order ID]))
I don't know how your DSum is working -- the syntax is incorrect. If you look
at DSum in Help, here is an example:
DSum("[Quantity]*[UnitPrice]", "Order Details", "[ProductID] = " _
& [ProductID])Yours should look like this:=IIf(IsNull([Mod
Price]),0,DSum("[Mod Price]","Mods Detail Query","[Order ID] = " & [Order ID]))|
| The Main Form "ORDERS" (Orders) Table| Order IDIs the Main Form displaying one
Order ID or multiple Order ID's?Are you totalling anything in the footer of this
form?| | First Subform "ORDER DETAILS" (Order Detail Query) Query| Order ID|
Line ID| Product ID| Product Name| Retail PriceIs it displaying one Order ID or
multiple Order ID's?In the footer of this subform are you totalling the Retail
Price?If it is displaying one Order ID, you should be able to just Sum the
Retail Price ... =Sum([Retail Price]) and make the Default Value = 0.| | Second
Subform "MODS DETAIL" (Mods Detail Query) Query| Order ID| Line ID| Mod ID| Mod
Name| Mod PriceIs this subform displaying one Order ID or multiple Order ID's?If
it is displaying one Order ID, you should be able to just Sum the Mod Price ...
=Sum([Mod Price]) and make the Default Value = 0.| | Above, is how its set-up.|
| If every record in Subform 1 has records in Subform 2, the textbox with | the
DSum expression in it works fine.| | If every record in Subform 1 has no records
in Subform 2, the textbox | with the DSum expression in it works fine.| | Its
only when the records in Subform 1 has both records and no records, | that the
textbox with the DSum expression doesn't work.How can Subform 1 have both
records and no records?| | I hope this is clearer!| Thanks| DS