Question : Override System Message with Personal Message

My tables primary key is set to Nio Duplicates.  When a duplicate is entered the system prompts a message of "the changes you requested to the table were not successful because....." I would like to replace this with a more intuative user message.  Is this code erroring out?  If so, what event would I error trap in?  I would like to override this system message but need to 1) stop this from happening and 2) replace it with my own custom message.

Answer : Override System Message with Personal Message

The code looks something like this:

Private Sub Form_Error(DataErr As Integer, Response As Integer)
   
    Response = acDataErrContinue
    Select Case DataErr
        Case 3022
            MsgBox "Your custom message here"
        Case Else
            MsgBox "An error has occurred " & Err.Number & "  " & Err.Description
    End Select

End Sub
Random Solutions  
 
programming4us programming4us