I am using the following code to rename my current file (basically added the current date to the file name and then importing the most recent file from excel into access and naming that the file name used for my queries.
DoCmd.TransferSpreadsheet transfertype:=acImport, SpreadsheetType:=5, _
tablename:="tblCommision", Filename:="tblCommision.xls", _
Hasfieldnames:=True
In thinking this through, I want to make sure that the user has the file saved in excel under the corrent name - If they don't the first part of the code to rename the current file will run but the new file won't import.
Any suggestion on making sure the excel file is there before running the code?
thanks!!
Fred
DoCmd.TransferSpreadsheet transfertype:=acImport, SpreadsheetType:=5, _
tablename:="tblCommision", Filename:="tblCommision.xls", _
Hasfieldnames:=True
In thinking this through, I want to make sure that the user has the file saved in excel under the corrent name - If they don't the first part of the code to rename the current file will run but the new file won't import.
Any suggestion on making sure the excel file is there before running the code?
thanks!!
Fred