Hello,
I would like to create an error trap for TransferText (much like thread 152642). The user pushes a button to upload the desired file into the database. If the file has new data everything works as expected. If the file has already been uploaded (old data) then it should fail and tell the user the data has already been uploaded. I do NOT like the "Microsoft Office Access was unable to append all the data to the table" error because users wouldn't understand it. I currently have the following:
DoCmd.SetWarnings False
DoCmd.TransferText acImportDelim, "Spec", "Table", Path, True, ""
If Err.Number = 10014 Then
msgbox "Not successful.", vbOKOnly, "Fail", "", vbError
Else
msgbox "Successful!", vbOKOnly, "Success!", "", vbInformation
End If
DoCmd.SetWarnings True
On Error goto X does not work either.
Is there a way to use try and catch to solve this problem?
Thank You!
Dequeue
I would like to create an error trap for TransferText (much like thread 152642). The user pushes a button to upload the desired file into the database. If the file has new data everything works as expected. If the file has already been uploaded (old data) then it should fail and tell the user the data has already been uploaded. I do NOT like the "Microsoft Office Access was unable to append all the data to the table" error because users wouldn't understand it. I currently have the following:
DoCmd.SetWarnings False
DoCmd.TransferText acImportDelim, "Spec", "Table", Path, True, ""
If Err.Number = 10014 Then
msgbox "Not successful.", vbOKOnly, "Fail", "", vbError
Else
msgbox "Successful!", vbOKOnly, "Success!", "", vbInformation
End If
DoCmd.SetWarnings True
On Error goto X does not work either.
Is there a way to use try and catch to solve this problem?
Thank You!
Dequeue