Why Won't This DCount Query Work?

DAPOOLE

Registered User.
Local time
Today, 18:10
Joined
Jan 14, 2010
Messages
38
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.
 
How about:
Me.MyTextbox = DCount("*", "[DBO_FINAL_PUMP]", "[PUMP]= '" & Me.UserDefined & "'")
 
Thanks. Was going mad there.
 

Users who are viewing this thread

Back
Top Bottom