How could be done code that would delete/remove all current tables in Access?
I have database where all tables are imported. After I finish working, I would like that all visible tables would be deleted or removed (excluded hidden and systemtables).
Call the following code from a "Delete All Talbes" button or similar.
Public Sub DeleteTables()
Dim tdf As TableDef
For Each tdf In CurrentDb.TableDefs
If Not Left(tdf.Name, 4) = "MSys" Then ' Don't delete System Tables
DoCmd.DeleteObject acTable, tdf.Name
DoCmd.Echo True, "Progress: Deleting table " & tdf.Name
End If
Next tdf
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.