[COLOR="SeaGreen"]'Close all open forms[/COLOR]
Dim frm As Object
For Each frm In CurrentProject.AllForms
If frm.IsLoaded Then
DoCmd.Close acForm, frm.Name
End If
Next frm
[COLOR="seagreen"]'Delete all current linked tables[/COLOR]
DoCmd.DeleteObject acTable, "Table1"
DoCmd.DeleteObject acTable, "Table2"
[COLOR="seagreen"]'Link tables[/COLOR]
DoCmd.TransferDatabase acLink, "Microsoft Access", "c:\Data\BE1.mdb", acTable, "Table1", "Table1", False
DoCmd.TransferDatabase acLink, "Microsoft Access", "c:\Data\BE2.mdb", acTable, "Table1", "Table2", False