Delete Table

  • Thread starter Thread starter alex
  • Start date Start date
A

alex

Delete Table

I have a report bound to a table (made with a make-table query).

I want to delete the table once the report is closed; I no longer need
it.

I can’t delete the object, however, when the report closes because the
report has the table locked and I don’t see an unload event for the
report.

Any advice?
Thanks,
alex
 
If SysCmd(acSysCmdGetObjectState, acReport, "rptYourReport") <> 0 Then
DoCmd.Close acReport, "rptYourReport"
End If

Regards

Kevin



Delete Table

I have a report bound to a table (made with a make-table query).

I want to delete the table once the report is closed; I no longer need
it.

I can’t delete the object, however, when the report closes because the
report has the table locked and I don’t see an unload event for the
report.

Any advice?
Thanks,
alex
 
 If SysCmd(acSysCmdGetObjectState, acReport, "rptYourReport") <> 0 Then
      DoCmd.Close acReport, "rptYourReport"
 End If

Regards

Kevin


Delete Table

I have a report bound to a table (made with a make-table query).

I want to delete the table once the report is closed; I no longer need
it.

I can’t delete the object, however, when the report closes because the
report has the table locked and I don’t see an unload event for the
report.

Any advice?
Thanks,
alex

Thanks for the response...
The report won't close, however (which seems weird putting close code
in a close event!).
I'm getting this error:
This action can't be carried out while processing a form or report
event
 
Assuming that you run this report more than once over a period of time and
it's not some fancy report created dynamically, don't delete the table.

Instead delete all the records in the table. Next convert your Make Table
query to an Append query to repopulate the table before running the report.
This could all be done in a macro or code.

Another option, and probably the best one, is to not use this temporary
table at all. Just turn your Make Table query into a Select query and use
that as the record source for the report. Of course if you are running
multiple queries on this table to clean up data, this may not work.
 
Don't put the code in the report's close event. Put it in the code that
executes to delete the table process.


If SysCmd(acSysCmdGetObjectState, acReport, "rptYourReport") <> 0 Then
DoCmd.Close acReport, "rptYourReport"
End If

Regards

Kevin


Delete Table

I have a report bound to a table (made with a make-table query).

I want to delete the table once the report is closed; I no longer need
it.

I can’t delete the object, however, when the report closes because the
report has the table locked and I don’t see an unload event for the
report.

Any advice?
Thanks,
alex

Thanks for the response...
The report won't close, however (which seems weird putting close code
in a close event!).
I'm getting this error:
This action can't be carried out while processing a form or report
event
 
Don't put the code in the report's close event.  Put it in the code that
executes to delete the table process.









Thanks for the response...
The report won't close, however (which seems weird putting close code
in a close event!).
I'm getting this error:
This action can't be carried out while processing a form or report
event- Hide quoted text -

- Show quoted text -

Thanks guys for the help...I'll look into these solutions.
alex
 
Back
Top