Why delete and recreate a querydef object when you can just change the .SQL property?
- by dblE
Do you remember the venerable old Microsoft Query by Form (QBF) VBA example from back in the day link that recommended that you delete an existing query and then recreate it dynamically?:
On Error Resume Next
db.QueryDefs.Delete ("qryResults")
On Error GoTo 0
Set qdf = db.CreateQueryDef("qryResults", "SELECT p.*...
Why not just change the SQL…