C
CLSWL
I have created the following code for the error of duplicate data. I have a
form and a subform. When I type duplicate info on the form I want it not
only to tell me that the data is duplicate but to go to the original record.
I don't know the syntax to cancel the BeforeUpdate event from the OnError
event.
Private Sub Form_Error(DataErr As Integer, Response As Integer)
If DataErr = 3022 Then
Response = acDataErrContinue
msgbox "You have entered duplicate data"
strDrawNo = Combo_DrawNo.Value
'NEED SOMETHING HERE TO CANCEL THE UPDATE OF THE FORM
Combo_DrawNo.SetFocus
DoCmd.FindRecord strDrawNo, acAnywhere
frmAssyDrawNo.SetFocus
End If
End Sub
form and a subform. When I type duplicate info on the form I want it not
only to tell me that the data is duplicate but to go to the original record.
I don't know the syntax to cancel the BeforeUpdate event from the OnError
event.
Private Sub Form_Error(DataErr As Integer, Response As Integer)
If DataErr = 3022 Then
Response = acDataErrContinue
msgbox "You have entered duplicate data"
strDrawNo = Combo_DrawNo.Value
'NEED SOMETHING HERE TO CANCEL THE UPDATE OF THE FORM
Combo_DrawNo.SetFocus
DoCmd.FindRecord strDrawNo, acAnywhere
frmAssyDrawNo.SetFocus
End If
End Sub