Need to unlock subreport recordsources on closing report

  • Thread starter Thread starter David
  • Start date Start date
D

David

I have reports created in an Access 2002 database that contain subreports
where the recordsource of these subreports is a temporary table. I need to
delete these temporary tables as soon as the report closes. I have code in
the report_close event to drop the table, but I get the error "The database
engine could not lock the table <table name> because it is already in use by
another person or process". I assume this is because the subreport
displaying this data is still open on the main report.


Is there anything I can do to release the table lock? I've tried changing
the subreports recordsource to release it, but that's not working.

Any help is appreciated!

_david
 
Yep. I've tried closing the subreport in the close event of the report
before dropping the temp tables, but it won't let me close it.
 
What happens if you base the subreport on a query defined as a "snapshot
query"? Base the query on the temp tables. Also, do you need to delete the
temp tables or just their data?
 
Back
Top