Well, I have made a lot of progress lately in figuring out all the quotes in SQL, VBA and Functions like DSum(). However this one has me stumped.
If I write the DSum with one set of Criteria it works fine, for each set. When I try and add the AND to get them both in one statement I get "Expected Expression".
Here are some results from the immediate Window. The first two are each of the criteria individually, along with results (Which are correct). The second two are using an AND statement to include them both. I added brackets around each of the expressions in the last of these two (Desperation!).
? DSum("CallQuantity","tblCCTransaction","EquityID = " & Me.cboTicker)
-100
?DSum("CallQuantity","tblCCTransaction","CallExpir e < #" & Date() & "#")
-100
?DSum("CallQuantity","tblCCTransaction","(EquityID = " & Me.cboTicker) & AND ("CallExpire < #" & Date() & "#")) -Gives "Expected Expression"
?DSum("CallQuantity","tblCCTransaction","EquityID = " & Me.cboTicker & AND "CallExpire < #" & Date() & "#") -Gives "Expected Expression"
I have looked over several threads here but have not found the answer. Any help here would be greatly appreciated as I am swimming at this point.
Thanks