Access Reference

Cancel an event

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]

6 community Q&A using Cancel an event

75 wordsMicrosoft Docs rev. 09/25/2018