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 & "#")