[AccessD] Modifying a query

Steve Conklin developer at ultradnt.com
Tue Jun 6 19:29:56 CDT 2006


Yep, need to edit the query def's SQL property:

Set q = Currentdb.querydefs("my_users_query")
q.SQL = "my new sql statement"
Currentdb.querydefs.refresh

Hth
Steve
 

-----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 8: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





More information about the AccessD mailing list