Dan Waters
dwaters at usinternet.com
Tue Sep 4 16:58:10 CDT 2007
I've never used a SELECT statement and the DoCmd.RunSQL method together. Use DoCmd.RunSQL with an INSERT INTO or an UPDATE or a DELETE. Or, Set rst = CurrentDB.OpenRecordset(strSQL,dbOpenSnapshot). Now you have a recordset to work with. Dan -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Kaup, Chester Sent: Tuesday, September 04, 2007 4:33 PM To: Access Developers discussion and problem solving Subject: [AccessD] Cannot run query in code. I have a module in which I compose several queries and run them. They all work fine. I added one more and now get a message of "A RunSQL action requires an argument consisting of an SQL statement". Below is the problem code. I have run out of ideas as to what the problem is. A compact and repair did nothing. Thanks. strSQL = "Select * from Monthly_Appended " DoCmd.RunSQL strSQL Chester Kaup Engineering Technician Kinder Morgan CO2 Company, LLP Office (432) 688-3797 FAX (432) 688-3799 No trees were killed in the sending of this message. However a large number of electrons were terribly inconvenienced. -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com