Public Sub linkTables(filePath As String)
Dim dbs As Database, tbd As TableDef, tbdNew As TableDef
Set dbs = OpenDatabase(filePath)
For Each tbd In dbs.TableDefs
If tbd.Attributes = 0 Then
Set tbdNew = CurrentDb.CreateTableDef(tbd.Name)
tbdNew.Connect = "MS Access;DATABASE=" & filePath
tbdNew.SourceTableName = tbd.Name
CurrentDb.TableDefs.Append tbdNew
Set tbdNew = Nothing
End If
Next tbd
dbs.Close
Set dbs = Nothing
End Sub