Right i can open a dialog to select the file to link to, and i can read the connection string for the table, but i can't get the string to be altered!
Code looks like this:
VB Code:
Private Sub Command0_Click() 'Opens the dialog RelinkFile ' Old Connect String Text1.Value = CurrentDb.TableDefs("stafflist").Connect ' Change connect string CurrentDb.TableDefs("staffList").Connect = "Excel 5.0;HDR=YES;IMEX=2;DATABASE=" & sFile ' Out put the 'new' connect string Text1.Value = CurrentDb.TableDefs("staffList").Connect ' Check the dialog actually collected the file name/path Text6.Value = sFile End Sub




Reply With Quote