I have a access application that creates a series of dynamic tables, the problem i am having is when i try to create a table that has already been created, i error handle this by deleting the old table and then recreating it. This is incase the data has changed. I do so like so:
Case 3010
If (tablesList.Value = "tblPetitions" And tablesInList.Value = "Petitions Percentage Calc" And AreaTotalCombo.Value = "Area Totals"
Then
DoCmd.DeleteObject acTable, OfficeCombo.Value & " Petitions % from " & qDateBegin & " to " & qDateEnd2
MsgBox "Old Table Deleted"
GoTo pet_start_point
End If
If (tablesList.Value = "tblPetitions" And tablesInList.Value = "Petitions Percentage Calc" And AreaTotalCombo.Value = "Show Offices" And OfficeCombo.Value = "Highlands and Islands"
Then
DoCmd.DeleteObject acTable, "HLands & Islands Pets Office % from " & qDateBegin & " to " & qDateEnd2
MsgBox "Old Table Deleted"
GoTo pet_start_point
Else
If (tablesList.Value = "tblPetitions" And tablesInList.Value = "Petitions Percentage Calc" And AreaTotalCombo.Value = "Show Offices"
Then
DoCmd.DeleteObject acTable, OfficeCombo.Value & " Pets Office % from " & qDateBegin & " to " & qDateEnd2
MsgBox "Old Table Deleted"
GoTo pet_start_point
End If
End If
-----------------------------------------------------------
Now the problem is now, when it goes back to the pet_start_point, the other error handlers are ignored. FOr example, so of the calculations could be handed a zero to divide by, the error handler should just by pass this. But once it seems to handle the Table Already Exists error, the rest of the error handlers dont seem to work.
Anyone know why?
Case 3010
If (tablesList.Value = "tblPetitions" And tablesInList.Value = "Petitions Percentage Calc" And AreaTotalCombo.Value = "Area Totals"
DoCmd.DeleteObject acTable, OfficeCombo.Value & " Petitions % from " & qDateBegin & " to " & qDateEnd2
MsgBox "Old Table Deleted"
GoTo pet_start_point
End If
If (tablesList.Value = "tblPetitions" And tablesInList.Value = "Petitions Percentage Calc" And AreaTotalCombo.Value = "Show Offices" And OfficeCombo.Value = "Highlands and Islands"
DoCmd.DeleteObject acTable, "HLands & Islands Pets Office % from " & qDateBegin & " to " & qDateEnd2
MsgBox "Old Table Deleted"
GoTo pet_start_point
Else
If (tablesList.Value = "tblPetitions" And tablesInList.Value = "Petitions Percentage Calc" And AreaTotalCombo.Value = "Show Offices"
DoCmd.DeleteObject acTable, OfficeCombo.Value & " Pets Office % from " & qDateBegin & " to " & qDateEnd2
MsgBox "Old Table Deleted"
GoTo pet_start_point
End If
End If
-----------------------------------------------------------
Now the problem is now, when it goes back to the pet_start_point, the other error handlers are ignored. FOr example, so of the calculations could be handed a zero to divide by, the error handler should just by pass this. But once it seems to handle the Table Already Exists error, the rest of the error handlers dont seem to work.
Anyone know why?