I have a report who's datasource is a table called MASTER.
I have form with a combobox with an on change action that drives a set of queries that are filtered by what is selected in the combo box
The final step in the process is to drop the current MASTER table, make a new MASTER TABLE, and set a primary key:
CurrentDb.TableDefs.Delete "Master"
DoCmd.OpenQuery "MASTER_MT"
DoCmd.RunSQL "CREATE INDEX ind ON [MASTER] ([DC]) With Primary"
everything worked well until I created a save button on the report with the following code:
DoCmd.OutputTo acOutputReport, "SalesCompare", acFormatPDF, "\\sdc-files\Sales Comparison\Reports" & FileName, 1
that works perfectly, however, after closing the form, and making another selection from the combo box, Run-Time 3211 error is generated at the point of dropping the MASTER table citing that it is locked and cannot be dropped. How is it locked if it was only accessed as a data source by a report that is already closed.
I have create a refresh button that clears the combo box and reloads the form. I have attempted to close the only recordset I have, even though it is not used to open the form or output the form or close the form. Remember this error began after adding the output command, and it appears as if the report is closed, but it's connection to the data source remains.
Any Ideas