G
Guest
I have a message box coded on a before update event. I need to know how to
change this code so if the users response is no the record/input will be
removed so the user can return to the switchboard to look up the order number
in another form. The ordernumber is a required field so it will not allow
the user to backout without inputting something at this point.
Here is the current code.
Private Sub ordernumber_BeforeUpdate(Cancel As Integer)
If DLookup("ordernumber", "qry ordernumbers", "ordernumber=" &
ordernumber.Value) Then
Cancel = (MsgBox("Duplicate Order, Do you want to Proceed?", vbQuestion +
vbYesNo)) = vbNo
If Cancel = 0 Then
Me!duplicate = True
End If
End If
End Sub
Please HELP!
Barry
change this code so if the users response is no the record/input will be
removed so the user can return to the switchboard to look up the order number
in another form. The ordernumber is a required field so it will not allow
the user to backout without inputting something at this point.
Here is the current code.
Private Sub ordernumber_BeforeUpdate(Cancel As Integer)
If DLookup("ordernumber", "qry ordernumbers", "ordernumber=" &
ordernumber.Value) Then
Cancel = (MsgBox("Duplicate Order, Do you want to Proceed?", vbQuestion +
vbYesNo)) = vbNo
If Cancel = 0 Then
Me!duplicate = True
End If
End If
End Sub
Please HELP!
Barry