Hi all
I am attempting to delete all but one table in my Access 2007 database.
All relationships have been deleted.
First, if I rem out the line db.TableDefs.Delete, then all the appropriate tables are displayed alphabetically.
However, when I include db.TableDefs.Delete, the process becomes inconsistent.
Currently only every second table is displayed and deleted, previously all but one table were deleted.
If I run the code a second time, the remainder of the tables are deleted.
Could it be that my Toshiba NB100 netbook is not up to the task?
I don't have another machine with Access 2007 installed.
I have tried to slow down execution of the code with MsgBox, and by using db.TableDefs.Refresh.
For Each tdf In dbs.TableDefs
If Left(tdf.Name, 4) <> "msys" And tdf.Name <> "tblUser" Then
MsgBox "Table to delete = " & tdf.Name
db.TableDefs.Delete tdf.Name
'db.TableDefs.Refresh
End If
Next tdf
Thanks in advance for any advice offered, I can't afford to lose any more hair.