G
Guest
Please help - I think this dropped off the radar because I couldn't look at
it for a week. Here is the original post and replies. Thanks! - I could not
get solution to work
Thanks John, I have been on another project so I wasn't able to revisit
this. I tried many times Friday and this morning. the solution and I get
the error "The syntax of subquery in this expression is incorrect - Check
subquery syntax and enclose subquery in parenthesis" I tried to enclose the
entire thing in parens and then I get expression too long error - any
suggestions? Thanks!
it for a week. Here is the original post and replies. Thanks! - I could not
get solution to work
Thanks John, I have been on another project so I wasn't able to revisit
this. I tried many times Friday and this morning. the solution and I get
the error "The syntax of subquery in this expression is incorrect - Check
subquery syntax and enclose subquery in parenthesis" I tried to enclose the
entire thing in parens and then I get expression too long error - any
suggestions? Thanks!
Was this post helpful to you?John Spencer (MVP) said:Assuming FormNumber is a text field. If form number is a number field then drop
the apostrophes (single quotes) in the DSum functions.
SELECT tblForms.FormName,
StartInventory
-NZ(DSum("AmountAdded","tblAddInv",""FormNumber='" & FormNumber & "'"),0)
-NZ(DSum("QtySent","tblOrderDetails","FormNumber='" & FormNumber & "'"),0) as CurrentInventory
FROM tblForms
This may be slow. If it is too slow, post back and we can come up with a more
complex solution.