Some of the fields are failing (I am getting an import error file), but I am not getting any warning message. I have explicitly turned on the warnings, but it didn't make a difference. If I manually import the table, the warnings appear ("Microsoft Access was unable to append all the data to the table. The contents of fields in X record(s) were deleted, and Y record(s) were lost due to key violations . . . ")
Does anyone have any ideas how to get these warnings to appear?
Note that the file (stSave) is importing, with the exception of a few fields.
Here is my code:
Expand|Select|Wrap|Line Numbers
- DoCmd.SetWarnings True
- If Right(importFile, 4) = ".xls" Then
- DoCmd.TransferSpreadsheet acImport, , tblName, stSave, True
- Else
- DoCmd.TransferText acImportDelim, , tblName, stSave, True
- End If