Thanks
Ian
.
dim qdf as dao.querydef
dim db as dao.database
set qdf=db.querydefs("MyQuery")
with qdf
.sql="Select * From tblMyTable Where MyID>3"
.close
end with
set qdf=nothing
set db=nothing
--
Sandra Daigle [Microsoft Access MVP]
Please post all replies to the newsgroup.
A query is really an SQL statement (in the QueryDef's SQL
property). With that in mind, why bother (re)constructing
the QueryDef's SQL statement when, most likely, you can
apply the new SQL statement to whatever you want to use the
query for.
It's can get rather messy trying to parse out a query's
Where clause. It's much easier to add a new Where clause
to an unfiltered query.
I could be more specific if you explained more about what
you have and what you want to accomplish.
--
Marsh
MVP [MS Access]