G
Guest
I am trying to write an update routine that can automatically add a link in my program files to a newly-created table in my data file.
I can get as far as "DoCmd.RunCommand acCmdLinkTables", but this alone opens a dialog that expects the user to browse to the data file location, then choose the table name. I already know both of these and want to automate this.
I started to continue with the code below, but got stuck on the last line. Am I close?
Dim DataFile as Object
TablePath = "<FullPathName>\<FileName>"
Set DataFile = DBEngine.Workspaces(0).OpenDatabase(TablePath, True)
DataFile.TableDefs("<TableName>").Connect = ";DATABASE=" & TablePath & ""
I can get as far as "DoCmd.RunCommand acCmdLinkTables", but this alone opens a dialog that expects the user to browse to the data file location, then choose the table name. I already know both of these and want to automate this.
I started to continue with the code below, but got stuck on the last line. Am I close?
Dim DataFile as Object
TablePath = "<FullPathName>\<FileName>"
Set DataFile = DBEngine.Workspaces(0).OpenDatabase(TablePath, True)
DataFile.TableDefs("<TableName>").Connect = ";DATABASE=" & TablePath & ""