Trying to use the following code:
but its not deleting all the tables starting with _!, it does if i uncomment the call in the IF statement...but that can't be way to do it!!
Is it because the number of td's change instantly? throwing the for each loop?
Code:
'deletes all tables starting with '_'
Dim db As DAO.Database
Dim td As DAO.TableDef
Dim X As Integer
Set db = CurrentDb
SysCmd acSysCmdClearStatus
X = 0
SysCmd acSysCmdInitMeter, "Deleting Old Tables...", db.TableDefs.Count
For Each td In db.TableDefs
If Left(td.Name, 1) = "_" Then
db.TableDefs.Delete td.Name
'DeleteTables 'for some odd reason it doesnt!
End If
SysCmd acSysCmdUpdateMeter, X: X = X + 1
Next td
SysCmd acSysCmdClearStatus
db.TableDefs.Refresh
Is it because the number of td's change instantly? throwing the for each loop?