Problem with a DoCmd.RunSQL construct

  • Thread starter Thread starter Brian
  • Start date Start date
B

Brian

If I create the following query and run it I get no
records:

SELECT AVAILABILITY.BookingDate
FROM AVAILABILITY
WHERE AVAILABILITY.BookingDate=#07/09/2004# And
AVAILABILITY.Period=1 And AVAILABILITY.Room="H4";

Looks like it is a problem with the date. I have a form
setup whereby a user enter a date and runs a SELECT query
(DoCmd.OpenQuery "QueryAv") with the same WHERE as the
one that fails but that returns records which suggests
that it is a problem using the DoCmd.RunSQL strSQL
construct.

Any ideas?
 
You can't use DoCmd.RunSQL with a SELECT statement: it's only for action
queries (INSERT INTO, UPDATE or DELETE)
 
Back
Top