I want to set up a regular import of data from an excel spreadsheet using transferspreadsheet.
How can I use a variable to write this command on the fly, using the variable to determine which spreadsheet will be imported. The variable will hold the file name, which will be calculated from the currant month and year, eg VarCurrentImport = "May2012".Code:DoCmd.TransferSpreadsheet acImport, 8, "ImportTable", "F:\SalesDatabase\May2012.xlsx", True, "MonthlyImport"
Many thanks
Ian