using the "cancel" feature....

  • Thread starter Thread starter Brad Pears
  • Start date Start date
B

Brad Pears

I have a situation where I want to use the cancel functionality. I have code
in a "before update" for a field on my form. A parameter associated with
this event is (cancel as integer).

How do I implement this cancel fucntionality? I have code in this event
that I want to skip if cancelled. How do I accomplish this? Do I simply set
cancel to 0 or 1?

Thanks,

Brad
 
Set the Cancel argument to True if you want to stop the update.

Private Sub Form_BeforeUpdate(Cancel As Integer)
If IsNull(Me.SomeField) Then
Cancel = True
MsgBox "You forgot to enter SomeField."
Else
'do your other stuff here.
End If
End Sub
 
Back
Top