Access 2000. I have a table with 3 fields indexed to prevent duplicates.
How do I get rid of the generic warning stating "Duplicate keys" etc. and
replace it with a custom warning of my choosing?..Thanks
This error can be trapped in the form's Error event. The error number is
3022.
Example:
Private Sub Form_Error(DataErr As Integer, Response As Integer)
Const DUPLICATE_INDEX = 3022
If DataErr = DUPLICATE_INDEX Then
MsgBox "This exercise is/was previously issued to this trainee. Please"
& vbCrLf & _
"select another exercise from this category or press the close form
button."
Response = acDataErrContinue
End If
End Sub

Signature
Wayne Morgan
MS Access MVP
> Access 2000. I have a table with 3 fields indexed to prevent duplicates.
> How do I get rid of the generic warning stating "Duplicate keys" etc. and
> replace it with a custom warning of my choosing?..Thanks
Randy - 09 Sep 2005 21:58 GMT
Thanks Wayne.
> This error can be trapped in the form's Error event. The error number is
> 3022.
[quoted text clipped - 14 lines]
>> How do I get rid of the generic warning stating "Duplicate keys" etc.
>> and replace it with a custom warning of my choosing?..Thanks