delete report record source on close

  • Thread starter Thread starter Robert Mooney
  • Start date Start date
R

Robert Mooney

I have a report that when opened executes VBA code to
gather data for the report. The VBA code writes to a
temporary table which is then the record source for the
report.

For security, I want to delete the temporary table when I
close the report. However, because the report is still
open, I cannot delete the table.

How can I accomplish this?

Bob Mooney
 
Bob,

One option is to use an event other than the Close event of the
report. Depending on the actual functioning of your database, for
example the On Activate event of the form which receives the focus
after the report closes.

Another is to use a custom menu bar for your report, and close via an
item on this menu bar, which deletes the table as part of its
procedure.

Another is instead of deleting the table itself, to retain the table's
existence, but delete all data from it.

- Steve Schapel, Microsoft Access MVP
 
Back
Top