Problems with DCount Delimiting (1 Viewer)

Hikari95

New member
Local time
Today, 06:33
Joined
Jul 16, 2012
Messages
5
I am trying to program an appointment booking system, and I am using DCount to check appointments that already exist to avoid clashes, but I am getting a Run Time error: 13 Type Mismatch. I am not sure why, because as far as I knew, Date and Time formats were delimited with "#". Have I got the syntax wrong, or is it my delimiters? Any advice would be greatly appreciated.

Code:
intTimeCheck = DCount("DocID", "tblAppointments", "AppDate = #" & txtAppDate & "#" And "AppTime = #" & txtTime & "#")
 

Addyman

Registered User.
Local time
Yesterday, 22:33
Joined
Dec 29, 2011
Messages
90
Try this:

Code:
intTimeCheck = DCount("DocID", "tblAppointments", "AppDate = #" & txtAppDate & "# And AppTime = #" & txtTime & "#")
 

Hikari95

New member
Local time
Today, 06:33
Joined
Jul 16, 2012
Messages
5
Try this:

Code:
intTimeCheck = DCount("DocID", "tblAppointments", "AppDate = #" & txtAppDate & "# And AppTime = #" & txtTime & "#")

Works like a charm! Thank you very much!
 

Users who are viewing this thread

Top Bottom