Access Reference

Cancel an event

Direct Answer

Cancel an event
is part of the Access VBA object model. This reference page documents its syntax, parameters, and typical usage.

Reference

Under some circumstances, you may want to include code in an event procedure that cancels the associated event. For example, you may want to include code that cancels the Open event in an Open event procedure for a form, preventing the form from opening if certain conditions are not met.

You can cancel the following events:

  • ApplyFilter**
  • BeforeDelConfirm
  • BeforeInsert
  • BeforeRender
  • BeforeUpdate
  • CommandBeforeExecute
  • DblClick
  • Delete
  • Dirty
  • Exit
  • Filter
  • NoData
  • Open
  • Undo
  • Unload

You cancel an event by setting an event procedure’s _Cancel_ argument to True.

!include[Support and feedback]

Reference: Access object-model documentation • updated 09/25/2018
. Rebuilt for readability; see the original for complete parameter matrices.