I have just created an ODBC and linked over 1000 tables. However for ease of use I want to be able to delete all of the tables where there are no records (100s). Can someone advise me of how to do this with code in a module?
Dim mydb As Database
Dim tbdefs As TableDefs
Dim tbdef As TableDef
Set mydb = CurrentDb
Set tbdefs = mydb.TableDefs
For Each tbdef In tbdefs
If DCount("*", tbdef.Name) = 0 Then
mydb.Execute "drop table " & "tbdef.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.