DSum with Multiple Criteria

Kodash

Registered User.
Local time
Today, 21:28
Joined
Feb 26, 2014
Messages
22
Hi Guys,

Hopefully someone can help me out, I can't seem to get my head around an issue i'm having with a DSum, the statement is:

Code:
=DSum("[Amount Used]","[tbl_Rwk_Used]","[Cage Number]='" & [IBC_Number] & "'" And "[ID]=" & [ID])

I've tested both statements separately and they work ok, but as soon as I add the "AND" operator, the whole field is summed and the criteria thrown out of the window apparently. :banghead:

[ID] Is the same in both tables and relates to a main record
[Cage Number] and [IBC_Number] are related in both tables, but are and are strings

Thanks In Advace
 
your AND is out in no man's land. Anything not inside quote marks is treated as a variable, so, your expression is trying to find out what value the variable AND contains.

You need to have it be inside the double quotes.
 
Thanks plog. Took a couple of seconds to sort out after you cleared it up :)
 

Users who are viewing this thread

Back
Top Bottom