View Full Version : Why Won't This DCount Query Work?


DAPOOLE
02-17-2010, 06:08 AM
I am trying to get a count from a table with the WHERE clause restricted by whatever parameter the user enters into the textbox called 'UserDefined' however it keeps compiling errors. The code is:

Me.MyTextbox = DCount("*", "[DBO_FINAL_PUMP]", "[PUMP]= " & Me.UserDefined & " ")


Thanks.

RuralGuy
02-17-2010, 06:14 AM
How about:
Me.MyTextbox = DCount("*", "[DBO_FINAL_PUMP]", "[PUMP]= '" & Me.UserDefined & "'")

DAPOOLE
02-17-2010, 06:17 AM
Thanks. Was going mad there.

RuralGuy
02-17-2010, 06:20 AM
You're welcome. Been there...Done that! :p