Sorry, yes. Here you are:
Code:
Sub Link_Tables(Optional HideTable As Boolean = True)
Dim wksp As Workspace
Dim TableName As String
'
' Open the specifications database
'
Set wksp = Workspaces(0)
Set SPECSDATABASE = wksp.OpenDatabase(DATABASENAME)
For Each tbl In SPECSDATABASE.TableDefs
If Left(tbl.Name, 4) <> "MSys" Then
Debug.Print "Linking to " & tbl.Name
DoCmd.TransferDatabase acLink, "Microsoft Access", DATABASENAME, A_TABLE, _
tbl.Name, tbl.Name
If HideTable Then Application.SetHiddenAttribute acTable, tbl.Name, True ' will hide the table "tbl.name"
End If
Next
SPECSDATABASE.Close
End Sub
DATABASENAME is a global variable containing the database location:
Global Const DATABASENAME As String = "\\eis-xxx-iv03147\web_sites$\cmpapp\dpgr\access_database\dmh rr\web_dmhrr_specs.mdb"
This routine is called when the main form of the desktop application is opened.