Dcount problem - Datatype mismatch

thmsjlmnt3953

Registered User.
Local time
Today, 06:41
Joined
May 20, 2014
Messages
120
Hi,

I'm trying to use DCOUNT to check to see if a date exists and if it does then i can cancel the input.
The code im using is as follows however its returning datatype mismatch.
Any help would be fantastic.

Code:
If DCount("[pick_date]", "tblPicker_Stats", "[pick_date] = '" & txtPickDate & "'") > 0 Then
MsgBox "Statistics for this date already exist", vbOKOnly, "Error"
End
End If
 
Last edited:
Sorry about that, added now
 
Hi,

Thats the page i used to try and build my DCOUNT howver still cant get it to work correctly?
 
In the link pay attention to the part where it says "For dates".
 
Ohh the difference a few #'s instead of 's make - i really should read more closely!!

Thanks for the help and apologies for my lack of reading properly! Working brilliantly now!

Thanks to you both :)
 

Users who are viewing this thread

Back
Top Bottom