Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

RunSQL problem

Status
Not open for further replies.

hedgracer

Programmer
Mar 21, 2001
186
US
here is the code:

Dim sSQL As String
sSQL = "SELECT SrcAccount, SrcUserId, Account, Sum(LastQty) AS SumOfLastQty FROM Fills_Data GROUP BY SrcAccount, SrcUserId, Account;"
DoCmd.RunSQL sSQL

When I click on the button to activite this code I get this error message:

Run-time error '2342': A RunSQL action requires an argument consisting of an SQL statement.

The Fills_Data table is an ODBC table residing in and SQL Server 2005 database. When I run the same code in an Access query the code works just fine. Can anyone help me on this? Thanks for all help in advance.

Dave
 
The DoCmd.RunSQL method executes ACTION queries only.
What do you want to do with your SELECTION query ?

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top