If you require a message box then you need to check for duplicates in the before_Update event for the control.
or
if this is the only Jet message to trap, then use the form_error event.
like this:
Private Sub Form_Error(DataErr As Integer, Response As Integer)
msgbox "Your message here"
Response = acDataErrContinue
End Sub