I have a database that is fully operational (thanks to everyone's help) now I'm doing some housekeeping. What I'm wanting to change is one query function; I have a form that performs a search based off criteria and uses VBA to generate an SQL string which is then passed to a listbox as its rowsource (nice summary of returned results). The user then presses a command button that exports the results to a report--when the button is pressed I did was create a query from the generated SQL statement using the function
myDB.CreateQuer yDef("queryName ", sqlString)
the query is created, then the report is opened based off that query. When the user closes the report the query is deleted using the function:
myDB.QueryDefs. Delete "queryName"
but when another search is run the query is re-created (same name) and the process repeats.
What I found is that MS Access does not re-allocate it's empty object space which will eventually produce memory problems. I know one can use the Compact and Repair utility in MS Access to reallocate the memory but I want to find a solution to where rather than deleting the query and re-creating it, is it possible to simply update the query with a different parameter and refresh the query?
myDB.CreateQuer yDef("queryName ", sqlString)
the query is created, then the report is opened based off that query. When the user closes the report the query is deleted using the function:
myDB.QueryDefs. Delete "queryName"
but when another search is run the query is re-created (same name) and the process repeats.
What I found is that MS Access does not re-allocate it's empty object space which will eventually produce memory problems. I know one can use the Compact and Repair utility in MS Access to reallocate the memory but I want to find a solution to where rather than deleting the query and re-creating it, is it possible to simply update the query with a different parameter and refresh the query?
Comment