Dan Waters
dwaters at usinternet.com
Tue Jun 6 19:37:42 CDT 2006
Rocky, I use this frequently: DBEngine(0)(0).QueryDefs("qryName").SQL = "SELECT * FROM tblMain WHERE Name = '" & stgName & "'" I don't know if this applies to a query embedded in a macro. Dan -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin - Beach Access Software Sent: Tuesday, June 06, 2006 7:20 PM To: Access Developers discussion and problem solving Subject: [AccessD] Modifying a query Dear List: Can you modify the criteria in an existing query through code? Usually I just construct the query as a SQL statement and use db.execute to run it. But this time I think it would be better to leave the query where it is and modify the criterion based on a selection by the user. The query is part of a predefined set of queries that were embedded in a macro by the user. MTIA, Rocky -- Rocky Smolin Beach Access Software 858-259-4334 www.e-z-mrp.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com