How do you reference the Table:Field to use in a file path? I have been trying the code below
I would like to reference a Tablel:Field to use in the path instead of hard coding the file name, as the name of the file will change between the branches that use it
For now The Table name is "Paths"
The Field names are "File Name" and "File Description"
Thanks for any help you can give
I would like to reference a Tablel:Field to use in the path instead of hard coding the file name, as the name of the file will change between the branches that use it
Code:
Dim strQryName As String, strXLFile As String, strXLFileName As String
strDB = CurrentDb.Name
strCurrentDir = Left(strDB, Len(strDB) - Len(Dir(strDB)))
[B]strXLFileName = ("SELECT [File Name] FROM [Paths] WHERE [Paths].[File Description]= *E-Room*")[/B]
strXLFile = "" & strCurrentDir & [B]strXLFileName & ".xls"[/B] strQryName = "Submit Road Rewards" 'Query Name
Set xlApp = CreateObject("Excel.Application")
Set wkb = xlApp.Workbooks.Open(strXLFile)
The Field names are "File Name" and "File Description"
Thanks for any help you can give
Comment