Geoff Codd
Registered User.
- Local time
- Today, 17:41
- Joined
- Mar 6, 2002
- Messages
- 190
I am using the following code to delete a group of temporary tables, when a particular form is closed, the problem I am having is that not all the tables will exist. When a table doesn't exist the code stops running and the remaing tables are not deleted. I need a way to loop through until all tables are deleted.
Private Sub Close_Form_Click()
On Error GoTo Err_Close_Form_Click
DoCmd.DeleteObject acTable, "tblDevolution_Electricity_(Data_Table)"
DoCmd.DeleteObject acTable, "tblDevolution_Electricity_(Running_Sum)_Present"
DoCmd.DeleteObject acTable, "tblDevolution_Electricity_(Running_Sum)_Previous"
DoCmd.DeleteObject acTable, "tblEnergy_Management_Statistics_(Temp)"
DoCmd.Close
Exit_Close_Form_Click:
Exit Sub
Err_Close_Form_Click:
Resume Exit_Close_Form_Click
Thanks in advance
Geoff
Private Sub Close_Form_Click()
On Error GoTo Err_Close_Form_Click
DoCmd.DeleteObject acTable, "tblDevolution_Electricity_(Data_Table)"
DoCmd.DeleteObject acTable, "tblDevolution_Electricity_(Running_Sum)_Present"
DoCmd.DeleteObject acTable, "tblDevolution_Electricity_(Running_Sum)_Previous"
DoCmd.DeleteObject acTable, "tblEnergy_Management_Statistics_(Temp)"
DoCmd.Close
Exit_Close_Form_Click:
Exit Sub
Err_Close_Form_Click:
Resume Exit_Close_Form_Click
Thanks in advance
Geoff