View Full Version : Dcount is always 0


Blkblts
01-19-2001, 01:28 PM
I have the code"
strCount = Forms![frmcallhis]![mbrid]
intCount = Dcount("[mbrid]","tblcall","[mbrid] = 'strCount'")
intcount = intcount + 1

intcount is always 0 even if there are several calls for mbrid

I'm just trying to get the count from tblcall based on a mbrid and up by 1.

Thanks

Pat Hartman
01-19-2001, 04:44 PM
Your DCount() is not finding the value you are looking for because of the quotes around strCount.

intCount = Dcount("[mbrid]","tblcall","[mbrid] = " & strCount)

If [mbrid] is a text field then you need to get the quotes imbedded in the contents of strCount.

strCount = "'" & Forms![frmcallhis]![mbrid] & "'"

Atomic Shrimp
01-20-2001, 12:57 PM
...or

intCount = Dcount("[mbrid]","tblcall","[mbrid] = '" & strCount) & "'")

Mike

Blkblts
01-22-2001, 05:21 AM
Thanks it works.... by the way my mbrid was a string value.

Much appreciation

kim