Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Modules / DAO / VBA / December 2006

Tip: Looking for answers? Try searching our database.

Running a SELECT statement

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
JoeA2006 - 08 Dec 2006 01:21 GMT
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
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.