Custom error message

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

There is a SQL error message that comes up saying that there is a duplicate
record for the index that I created and that the record cannot be saved. Is
there a way to have a custom error message that actually makes sensecome up
instead of that one.

Thanks in advance
 
Use the Error event of the form.
Trap DataErr 3022.
Set up your own MsgBox.
Set Response = acDataErrContinue
 
Allen-

I am trying to trap the error message by saying:
"If Err.Message = "error # of the message"" but the error number that is
coming up is 0 which doesn't make sense to me. Also I am not sure how to not
get the real message not to come up. I am not sure what "Set Response =
acDataErrContinue" does but it was coming up with a syntax error using it.

Thanks in advance,
John
 
Back
Top