When I try to run the following
DoCmd.RunSQL "Select tblTest.* From tblTest"
I get an error 2342 A RunSQL Action requires an argument consistent with an
SQL statement. What am I missing
Ken Snell (MVP) - 08 Dec 2006 02:31 GMT
DoCmd.RunSQL will only run action queries. Your SQL statement is a select
query, therefore it doesn't work.
If you want to display the datasheet view from the query, try
DoCmd.OpenQuery method.

Signature
Ken Snell
<MS ACCESS MVP>
> When I try to run the following
> DoCmd.RunSQL "Select tblTest.* From tblTest"
> I get an error 2342 A RunSQL Action requires an argument consistent with
> an
> SQL statement. What am I missing
Daniel - 08 Dec 2006 02:41 GMT
RunSQL is a method of the DoCmd object in Microsoft Access. It is designed
for DML SQL, such as UPDATE, INSERT and DELETE statements. You cannot
"execute" a SELECT query so the RunSQL method will fail if you attempt to
pass a select statement to it.
Check out
http://www.databasejournal.com/features/msaccess/article.php/3505836
Daniel
> When I try to run the following
> DoCmd.RunSQL "Select tblTest.* From tblTest"
> I get an error 2342 A RunSQL Action requires an argument consistent with an
> SQL statement. What am I missing