I am trying to present the user with a more friendly error messsage than the
following which occurs when the user adds a record with a with a duplicate
value in an index.
"The changes you requested to the table were not successful because they would create duplicate values in the index, primary key, or
relationship......."
This message does not appear to have an error number.
I have the following code in the forms error event:
If DataErr = 3022 Then
MsgBox "There is already a company by the same name or" & Chr(13) &
" a person with the same first and last name in the database", vbOKOnly,
"Error"
Response = acDataErrContinue
Else
Response = acDataErrDisplay
End If
The above code does not trap the generic error message.
There are three fields involved (lastname, firstname, and companyname.) I
should mention that the code is in a form that is used only to add a new
name and that the error occurs when I try and close the form (Insert the new record.)
Any help would be appreciated.
following which occurs when the user adds a record with a with a duplicate
value in an index.
"The changes you requested to the table were not successful because they would create duplicate values in the index, primary key, or
relationship......."
This message does not appear to have an error number.
I have the following code in the forms error event:
If DataErr = 3022 Then
MsgBox "There is already a company by the same name or" & Chr(13) &
" a person with the same first and last name in the database", vbOKOnly,
"Error"
Response = acDataErrContinue
Else
Response = acDataErrDisplay
End If
The above code does not trap the generic error message.
There are three fields involved (lastname, firstname, and companyname.) I
should mention that the code is in a form that is used only to add a new
name and that the error occurs when I try and close the form (Insert the new record.)
Any help would be appreciated.