The code was originally hard coded to export a query to a specific path as 
follows:
TheFileName = "S:\Comparision Reports Access 
Queries\qryExportToExcelBudgetInfo-" & TheDate & ".xls"

DoCmd.TransferSpreadsheet acExport, 8, "qryExportToExcelBudgetInfo", 
TheFileName, True, ""

MsgBox ("File Exported to " & TheFileName)

The above query exports to:
S:\Comparision Reports Access Queries\qryExportToExcelBudgetInfo-04_24_10.xls

I need to export a query to a path stored in a table plus add the remainder of 
the file name with the current date to Excel.

For example, the lookup table has a field C:\Reports\. That path can be changed 
at any time. When a query is exported, it needs to use the path in the lookup 
table plus the query name plus the date.

Example: This query exports to:
C:\Reports\qryExportToExcelBudgetInfo-04_24_10.xls

I am having trouble combining the path variable name with the query name plus 
the current date to create TheFileName.

Vickie

Reply via email to