Customizing Error Message ...

  • Thread starter Thread starter Alex
  • Start date Start date
A

Alex

I have a field on a form that is the primary key of a
Bound form named [LABEL INFO], when I scaned a value that
already exist it sends the error message:

"The changes you requested to the table were not
successfull becouse they would create duplicate values in
the index, primary key, or relationship. Change the data
in the field or fields that contain duplicate data, remove
the index, or redefines the index to permit duplicate
entries and try again".

I would like to know how can I trap this error and put a
customize error message.
 
Tina thanks!!!, thats just what I need't ...
-----Original Message-----
add a procedure to the form's OnError event, as

Private Sub Form_Error(DataErr As Integer, Response As
Integer)

If DataErr = 3022 Then
MsgBox "Put your custom message here."
Response = acDataErrContinue
End If

End Sub

fyi, you can initially trap form (record) errors here too,
so you can identify the error number, as

Private Sub Form_Error(DataErr As Integer, Response As
Integer)

MsgBox DataErr

End Sub


-----Original Message-----
I have a field on a form that is the primary key of a
Bound form named [LABEL INFO], when I scaned a value that
already exist it sends the error message:

"The changes you requested to the table were not
successfull becouse they would create duplicate values in
the index, primary key, or relationship. Change the data
in the field or fields that contain duplicate data, remove
the index, or redefines the index to permit duplicate
entries and try again".

I would like to know how can I trap this error and put a
customize error message.
.
.
 
Back
Top