Running a SELECT statement

J

JoeA2006

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
 
K

Ken Snell \(MVP\)

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