Results 1 to 5 of 5

Thread: [Resolved][Access 97] Deleting Linked tables

Threaded View

  1. #1

    Thread Starter
    Hyperactive Member Davadvice's Avatar
    Join Date
    Apr 2007
    Location
    Glasgow (Scotland)
    Posts
    440

    Resolved [Resolved][Access 97] Deleting Linked tables

    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

    Code:
    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
    Thanks in advance

    David
    Last edited by Davadvice; Nov 21st, 2007 at 08:57 AM. Reason: Resolved

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width