I'm utilizing the DoCmd.TransferSpreadsheet acExport Function to create the excel file I need from a query. In order to improve the automation, I need to automatically replace the xxx.xlsx file name with a variable from a form which also contain the sorting parameters for the query, the user or the system can determine a different name as the file name every time. Can you please give me any idea how to determine the variable file name?
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel12Xml, "SortedProductsQuery", "C:\Exports\xxxxx.xlsx", True
Thank you
Menni