Help with running dynamic SQL queries

  • Thread starter Thread starter Asaf Bar-Lev
  • Start date Start date
A

Asaf Bar-Lev

To all the Access gurus!

I am experiencing some trouble using the DoCmd.RunSQL command. For some
reason I get run time error 2342 (A RunSQL action requires an argument
consisting of an SQL statement).
The weird thing is that the same statement I pass to RunSQL works fine when
I run it as a regular query, I just need to make modifications to the
queries WHERE clause on the fly.

Please help!

Asaf.
 
It might help if you showed use your SQL you are trying to run. Is it an
action query?
 
RunSQL is for Action queries only. I don't believe you can open a sql
statement without first creating a query. You can modify the SQL of any
query on the fly.
 
Back
Top