R
ragtopcaddy via AccessMonster.com
I am trying to replace the Access msg (with no runtime error # in the dialog
box):
"The changes you requested to the table were not successful because 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 redefine the index to permit duplicate entries and try again."
with my own using the following code:
Private Sub Form_Error(DataErr As Integer, Response As Integer)
If Err.Number = 3022 Then
Response = acDataErrContinue
MsgBox "You tried to enter a pair of indices that are already represented
in the recordset." & vbCrLf & _
"Please OK this msg box and hit the ""Esc"" key to clear the error.
" & vbCrLf & _
"You can then find and change the MR Level for the indices or add
2 different indices.", _
vbOKOnly + vbCritical, "Duplicate Record"
End If
End Sub
If it was working, I wouldn't be posting, so what gives? Err.Number = 0 when
the code runs, so nothing happens and the same old access msg is displayed.
Thanks,
Bill
--
Bill Reed
"If you can't laugh at yourself, laugh at somebody else"
Message posted via AccessMonster.com
box):
"The changes you requested to the table were not successful because 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 redefine the index to permit duplicate entries and try again."
with my own using the following code:
Private Sub Form_Error(DataErr As Integer, Response As Integer)
If Err.Number = 3022 Then
Response = acDataErrContinue
MsgBox "You tried to enter a pair of indices that are already represented
in the recordset." & vbCrLf & _
"Please OK this msg box and hit the ""Esc"" key to clear the error.
" & vbCrLf & _
"You can then find and change the MR Level for the indices or add
2 different indices.", _
vbOKOnly + vbCritical, "Duplicate Record"
End If
End Sub
If it was working, I wouldn't be posting, so what gives? Err.Number = 0 when
the code runs, so nothing happens and the same old access msg is displayed.
Thanks,
Bill
--
Bill Reed
"If you can't laugh at yourself, laugh at somebody else"
Message posted via AccessMonster.com