I have a complex report that contains 12 sub-reports. All the sub-reports use the same data which is generated by a rather complex set of queries.
When I tried to use the queries for the report it took forever to generate, so I took the query results and saved it to an indexed table and the report runs great.
So..., since the indexed table is only needed for the execution of this report, I decided to write the code in the Report_Open procedure to create the table and populate it with the results from the query (WHICH IS WORKING GREAT !!!). I then want to write code in the Report_Close procedure that would delete the table. There is no reason for the table to exist other than during the generation of this report.
The problem is when I try to execute the code in the Report_Close procedure...
Dim db As Database
Set db = currentDB
db.TableDefs.Delete ("my_temporary_Table"
I get a run-time error 3211
The database engine could not lock table "my_tempoary_table"
because it is in use by another person or process.
The process that has the table open is the REPORT that I am now trying to close. Is there a way to "close" the table so that I can delete it using code in the Report_Close procedure ?
When I tried to use the queries for the report it took forever to generate, so I took the query results and saved it to an indexed table and the report runs great.
So..., since the indexed table is only needed for the execution of this report, I decided to write the code in the Report_Open procedure to create the table and populate it with the results from the query (WHICH IS WORKING GREAT !!!). I then want to write code in the Report_Close procedure that would delete the table. There is no reason for the table to exist other than during the generation of this report.
The problem is when I try to execute the code in the Report_Close procedure...
Dim db As Database
Set db = currentDB
db.TableDefs.Delete ("my_temporary_Table"
I get a run-time error 3211
The database engine could not lock table "my_tempoary_table"
because it is in use by another person or process.
The process that has the table open is the REPORT that I am now trying to close. Is there a way to "close" the table so that I can delete it using code in the Report_Close procedure ?