G
Guest
Is there a way to make an event occur when you click the close button of a
query in dataview.
I have a query set up in VBA and it needs to be erased so when the user
clicks on the search button it can recreate the new query with the different
search criteria. right now I have it setup as:
Dim dbs As DAO.Database
Dim qdf As DAO.QueryDef
Set dbs = CurrentDb
Set qdf = dbs.CreateQueryDef("OBRQuery", strSQL)
DoCmd.OpenQuery "OBRQuery", , acReadOnly
dbs.QueryDefs.Delete ("OBRQuery")
and instead of deleting the query as soon as it's opened, it needs to wait
until after the user closes the form so they can sort the information in the
query. I tried putting the variable declerations and delete method before the
create method and it came up with an error.
query in dataview.
I have a query set up in VBA and it needs to be erased so when the user
clicks on the search button it can recreate the new query with the different
search criteria. right now I have it setup as:
Dim dbs As DAO.Database
Dim qdf As DAO.QueryDef
Set dbs = CurrentDb
Set qdf = dbs.CreateQueryDef("OBRQuery", strSQL)
DoCmd.OpenQuery "OBRQuery", , acReadOnly
dbs.QueryDefs.Delete ("OBRQuery")
and instead of deleting the query as soon as it's opened, it needs to wait
until after the user closes the form so they can sort the information in the
query. I tried putting the variable declerations and delete method before the
create method and it came up with an error.