Delete backup tables
Public Sub DeleteBackupTables()
Dim tbl As Variant
For Each tbl In CurrentData.AllTables
If InStr(1, tbl.Name, "Backup", vbTextCompare) > 0 Then
If vbYes = MsgBox("Delete table " & tbl.Name & "?", _
vbYesNoCancel Or vbQuestion, _
"Confirm Table Deletion") Then
DoCmd.DeleteObject acTable, tbl.Name
End If
End If
Next
End Sub
Related examples in the same category