Help with running dynamic SQL queries

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.
 
D

Duane Hookom

It might help if you showed use your SQL you are trying to run. Is it an
action query?
 
D

Duane Hookom

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

DoCmd.RunSQL HELP!!! I will not work! 1
VBA -- SQL 9
Using Date fields in SQL 2
SQL Error 2
A SQL statement in VBA 7
SQL Query in VBA 9
Running a SELECT statement 2
trouble with QBF and multiple choices 0

Top