I have a sub-form - the primary key is the main group number nad effective date - when someone adds a record that already exists, I want to use my own message but I also want to cancel out the record they were adding. I know how to isolate the error, however, how do I cancel the record when they click ok ??? thanks!!!
Here is what I have in the error section
If Err.Number = 3022 Then
MsgBox "There is already a record in the quality table with the same effective" _
& "date and main group number - please click cancel to remove this entry"
How do I cancel the operation???
Else
MsgBox Err.DESCRIPTION
Resume Exit_Command46_Click
Here is what I have in the error section
If Err.Number = 3022 Then
MsgBox "There is already a record in the quality table with the same effective" _
& "date and main group number - please click cancel to remove this entry"
How do I cancel the operation???
Else
MsgBox Err.DESCRIPTION
Resume Exit_Command46_Click