A family of Microsoft relational database management systems designed for ease of use.
Hi grimwadec,
There's no such function as ELookup(). In Access, it's DLookup().
Also, since all you're doing is changing the path to the file, you don't need to specify the worksheet, since you had to specify it when you first connected. Just set the Connect property to the path and filename.
"grimwadec" wrote in message news:*** Email address is removed for privacy *** .com...
OK so here's the code I tried:
Dim tdf As DAO.TableDef, ExcelPath As String
ExcelPath = ELookup("ExcelPath", "tblSundries", , "ExcelPath DESC")
Set tdf = DBEngine(0)(0).TableDefs("tblClubsSrc")
tdf.Connect = Left(tdf.Connect, InStr(1, tdf.Connect, "DATABASE=") + 8) & (ExcelPath & "\Clubs$")tdf.RefreshLink
Set tdf = Nothing
The worksheet in EntrySheet.xls is called "Clubs". I get Run-time error 3044 message*"C:\TrialFolder\EntrySheet.xls\Clubs$"* is not a valid path but I note that the preceding italicised text matches what I achieve using the Linked Table Manager which reflectstblClubsSrc (C:\TrialFolder\EntrySheet.xls\Clubs$)
so I presume there is something wrong with the way I have put the ExcelPath and the Worksheet name together. Perhaps if I had tried to solve a problem I previously had using GetExcel and Detect Excel I might have been able to solve this issue! Help please!
Regards, Graham R Seach Microsoft Access MVP Sydney, Australia