Dcount with number criteria

ebodin

Registered User.
Local time
Yesterday, 18:56
Joined
Apr 25, 2005
Messages
15
I'm trying to make this Dcount work

int2 = DCount("*", "Tbl_Findings", Audit_ID = int3)

I've searched the forum and pondered other examples. I don't think I need any quotes since the criteria is a number. I've verified that the int3 is what I want it to be immediately before the Dcount, but the result of the function is as if I haven't put in any criteria. It gives me the count of all the records in the table, not just the ones where Audit_ID is equal to int3.

Any suggestions?

thanks
 
You have to place double quotes around the entire last part like this:

int2 = DCount("*", "Tbl_Findings", "Audit_ID = " & int3)

That should give you what you want.
 
Last edited:
It works!

I could have sworn that I tried that. Apparently my compiler doesn't believe me, it only believes you.

Thanks Vassago.

I'll be back.
 

Users who are viewing this thread

Back
Top Bottom