I know how to delete a table (Docmd.DeleteObject) but does anyone know how to run through all the tables of a database using code and delete all automatically generated error tables i.e. All tables which contain "_ImportErrors" in their names?
This will delect all tables who's names end with "_ImportErrors"
Sub mDelete()
Dim db As Database
Dim tbl As TableDef
Set db = CurrentDb
For Each tbl In db.TableDefs
If Right$(tbl.Name, 13) = "_ImportErrors" Then
DoCmd.DeleteObject acTable, tbl.Name
End If
Next
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.