Import Errors table

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Is there a way of checking whether an import error has occurred during the
transfer of the contents of an Excel worksheet into an access table?

This happens in the code I've written where the userof the worksheet has
written a text entry where a number should have been entered in the
worksheet. A new table with the name _ImportErrors* is created when an Import
error occurs but I want some code to firstly delete any such tables that
exist before I carry out the transfer and then check if any such tables exist
after the transfer has completed

Help would be appreciated!
 
Yes, you could do that. First, do a DeleteObject on the name of the import
errors file. (Be sure to set you error handling off - On Error Resume Next)
Do the transfer.
Try to open the import errors table. If you get an error 3078, then there
were no errors, because the errors table was not created.

My preference, however, is to link to the spreadsheet, do my own data
editing, then append the data to an existing table, and delete the link.

One of the main advantages is that you can define the data types and sizes
of the table you are putting the data in. The other is you have more control
over the correction of the errors.
 
Back
Top