In the past I have tested the following code to delete a table and it seemed to work.
Sub Delete_Table()
Dim cat as ADOX .Catalog
Dim strTableName as String
Set cat = New ADOX.Catalog
strTableName = “flkpTable1”
cat.ActiveConnection = CurrentProject.Connection
cat.Tables.Delete strTableName
Set cat = Nothing
End Sub
I have a odd problem now where I have a table in the backend with the same name as a table in the frontend. The backend table is not linked but I would like to delete it because it is just taking up space. The problem is this code deletes the front end table not the backend one. Not having used this code with regularity, is there a means to modify it so only the backend table will be deleted? Or, is there another means to delete the backend table only?
Any suggestions are greatly appreciated.
Eddy
Sub Delete_Table()
Dim cat as ADOX .Catalog
Dim strTableName as String
Set cat = New ADOX.Catalog
strTableName = “flkpTable1”
cat.ActiveConnection = CurrentProject.Connection
cat.Tables.Delete strTableName
Set cat = Nothing
End Sub
I have a odd problem now where I have a table in the backend with the same name as a table in the frontend. The backend table is not linked but I would like to delete it because it is just taking up space. The problem is this code deletes the front end table not the backend one. Not having used this code with regularity, is there a means to modify it so only the backend table will be deleted? Or, is there another means to delete the backend table only?
Any suggestions are greatly appreciated.
Eddy