strSQL = qdef.QueryDef possible?

M

mcnews

is it possible to get the sql definition of a defined query stored in
a string?
i need users to be able to design there queries with GUI, but i also
need to be able to modify what they have with VBA.

thanks,
mcnews
 
A

Allen Browne

A QueryDef has a SQL property:

Dim qdf As QueryDef
Set qdf = dbEngine(0)(0).QueryDefs("MyQuery")
strSQL = qdf.SQL
Set qdf = Nothing
 
Top