My code is the following: but it has to load each table individually and it takes a really long time - especially because the new file is somewhere else on the network. Is there a way to load all tables from one file at once? Also, is there a way to unload all at once...say all the tables in a given mdb?
Public Sub LinkTables(FileName As String)
Dim NewDatabase As Database
Dim TableCounter As Integer
Set NewDatabase = OpenDatabase(FileName)
TableCounter = 0
While TableCounter < NewDatabase.TableDefs.count
DoCmd.TransferDatabase acLink, _
"Microsoft Access",FileName, acTable, _
NewDatabase.TableDefs(TableCounter).Name, _
NewDatabase.TableDefs(TableCounter).Name
TableCounter = TableCounter + 1
Wend
End Sub
thanks in advance,
Jon
Public Sub LinkTables(FileName As String)
Dim NewDatabase As Database
Dim TableCounter As Integer
Set NewDatabase = OpenDatabase(FileName)
TableCounter = 0
While TableCounter < NewDatabase.TableDefs.count
DoCmd.TransferDatabase acLink, _
"Microsoft Access",FileName, acTable, _
NewDatabase.TableDefs(TableCounter).Name, _
NewDatabase.TableDefs(TableCounter).Name
TableCounter = TableCounter + 1
Wend
End Sub
thanks in advance,
Jon