Mike,
I have a button on a form that appends records to a table. What I am trying to do is replace the MS access error message when there are problems with the append.
Here is my code, I tried to use the help but it does not seem to be working -
Private Sub Command3_Click()
Dim Response, strMsg As String
strMsg = "Test"
SetOption "Confirm Action Queries", False
DoCmd.OpenQuery "LARuploadAppendToEtes", acViewNormal, acEdit
On Error GoTo ErrorHandler
SetOption "Confirm Action Queries", True
Response = MsgBox("Etes Updated excluding Errors", vbInformation, "Update eTES from LAR spreadsheet"
Exit Sub ' Exit to avoid handler.
ErrorHandler:
' Display error information.
MsgBox "Error number " & Err.Number & ": " & Err.Description
' Resume with statement following occurrence of error.
Resume Next
End Sub
Also, what are the error codes for -
- type conversion failure
- key violations
- lock violations
- validation rule violations