For this process, my program imports an Excel file into a table.
The steps are as follows:
-Delete everything from the table
-Import the new data.
I have all the error trapping but the problem I have is if the user selects the wrong Excel file, the code will delete everthing from the table and on the transfer give me the error.
The logic I'm using now (which is repetitiou) is
-Import the data
-Delete the data
-Import the data
the first import is just to see if it will generate an error.
Anyone have a better suggestion? Thanks.
The code to import and delete is below:
CurrentDb.Execute "DELETE * FROM TABLE;", dbFailOnError
DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel9, "TABLE", strFileName, True, "A:I"
The steps are as follows:
-Delete everything from the table
-Import the new data.
I have all the error trapping but the problem I have is if the user selects the wrong Excel file, the code will delete everthing from the table and on the transfer give me the error.
The logic I'm using now (which is repetitiou) is
-Import the data
-Delete the data
-Import the data
the first import is just to see if it will generate an error.
Anyone have a better suggestion? Thanks.
The code to import and delete is below:
CurrentDb.Execute "DELETE * FROM TABLE;", dbFailOnError
DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel9, "TABLE", strFileName, True, "A:I"