DSum with multiple criteria

G

GD

What's wrong with this DSum (I'm getting the #Error message):

DSum("[NUMREC]","T06_REC","[ID]=" & [T11_RecBySourceChart]![ID] & " And
[Source] ='Mueller'")

I need to return the [NUMREC] (number format) from the T06_REC table where
the [ID] field matches the [ID] field in T11_RecBySourceChart table (both
text format), and the [Source] field (text format) in the T06_REC = Mueller.

THANKS!!!
 
J

John W. Vinson

What's wrong with this DSum (I'm getting the #Error message):

DSum("[NUMREC]","T06_REC","[ID]=" & [T11_RecBySourceChart]![ID] & " And
[Source] ='Mueller'")

I need to return the [NUMREC] (number format) from the T06_REC table where
the [ID] field matches the [ID] field in T11_RecBySourceChart table (both
text format), and the [Source] field (text format) in the T06_REC = Mueller.

THANKS!!!

If the ID field is of Text datatype (not "format", that's a different
property) you need the syntactically required quotemarks:

DSum("[NUMREC]","T06_REC","[ID]='" & [T11_RecBySourceChart]![ID] & "' And
[Source] ='Mueller'")

Spacing it out for readability (don't do it this way) that's

DSum("[NUMREC]","T06_REC","[ID]=' " & [T11_RecBySourceChart]![ID] & " ' And
[Source] ='Mueller'")
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top