Function RemoveALLIndices() As Boolean
Dim idx As DAO.Index
Dim tdf As DAO.TableDef
Dim db As DAO.Database
Dim intIdx As Integer
Set db = CurrentDb
For Each tdf In db.TableDefs
If Left(tdf.Name, 4) <> "Msys" Then
If (tdf.Attributes And dbAttachedTable) = 0 And (tdf.Attributes And dbAttachedODBC) = 0 Then
For intIdx = tdf.Indexes.Count - 1 To 0 Step -1
tdf.Indexes.Delete tdf.Indexes(intIdx).Name
Next
End If
End If
Next
RemoveALLIndices = True
End Function
|