I haven't been able to find the answer to this elsehwere, and I know someone here will have the answer: What function does (Cancel as Integer) serve in code and why does it appear only on some subs and not other?
The Cancel variable gives you an opportunity to tell Access to cancel the current event.
The place where I use this most often is the BeforeUpdate event of a form. The BeforeUpdate event is the last event executed before Access actually saves the current record. This gives you one last chance to edit the data entered on the form. If a problem is found - display a message box that describes the problem and follow it with:
Cancel = True
This tells Access to cancel the update event and not save the record.