I have a working code linking all table.I want to rearrange it so that the table "calls" is not linked.Can you help me? My code is the following:
Public Function LinkAllTables(DBName)
'link all user tables in source database
Dim FrontDB As DAO.Database, BackDB As DAO.Database
Dim Tbl As DAO.TableDef, Lnk As DAO.TableDef
Set FrontDB = CurrentDb
Set BackDB = OpenDatabase(DBName)
For Each Tbl In BackDB.TableDefs
If Tbl.Attributes = 0 Then
Set Lnk = FrontDB.CreateTableDef( _
Name:=Tbl.Name)
Lnk.SourceTableName = Tbl.Name
Lnk.Connect = ";DATABASE=" & BackDB.Name
FrontDB.TableDefs.Append Lnk
End If
Next
DoCmd.Beep
End Function
Public Function LinkAllTables(DBName)
'link all user tables in source database
Dim FrontDB As DAO.Database, BackDB As DAO.Database
Dim Tbl As DAO.TableDef, Lnk As DAO.TableDef
Set FrontDB = CurrentDb
Set BackDB = OpenDatabase(DBName)
For Each Tbl In BackDB.TableDefs
If Tbl.Attributes = 0 Then
Set Lnk = FrontDB.CreateTableDef( _
Name:=Tbl.Name)
Lnk.SourceTableName = Tbl.Name
Lnk.Connect = ";DATABASE=" & BackDB.Name
FrontDB.TableDefs.Append Lnk
End If
Next
DoCmd.Beep
End Function