Hi,
I have access 97 db and i want to deleted the tables that are linked to another DB. the reason for this is i have the live DB and want to relink to a development dataset.
The below code works however it has errors. the reason for the error is that the index of the table def changes once i have deleted a table.
can anyone sugest how i can keep the index while deleting the linked tables
Thanks in advanceCode:Public Sub delTableLinks() Dim db As Database Dim tdfNew As TableDef Dim i As Integer Dim fld As Field Dim j As Integer Set db = currentdb j = db.TableDefs.Count For i = 1 To j Set tdfNew = db.TableDefs(i) If Len(tdfNew.Connect) > 1 Then db.TableDefs.Delete (tdfNew.Name) End If Next End Sub
David




Reply With Quote