BeforeInsert, AfterInsert Events

Applies To

Form.

Description

These events occur:

  • BeforeInsert — when the user types the first character in a new record, but before the record is actually created.
  • AfterInsert — after a new record is added.

Note Setting the value of a control using a macro or Visual Basic doesn’t trigger these events.

Remarks

You can use an AfterInsert event procedure or macro to requery a recordset whenever a new record is added.

The BeforeInsert and AfterInsert events are similar to the BeforeUpdate and AfterUpdate events. These events occur in the following order:

BeforeInsert BeforeUpdate AfterUpdate AfterInsert

The following table summarizes the interaction between these events.

Event Occurs when
BeforeInsert User types the first character in a new record.
BeforeUpdate User updates the record.
AfterUpdate Record is updated.
AfterInsert Record updated is a new record.


If the first character in a new record is typed into a text box or combo box, the BeforeInsert event occurs before the Change event.

See Also

BeforeUpdate, AfterUpdate Events; Change Event; Current Event; Delete, BeforeDelConfirm, AfterDelConfirm Events; GoToRecord Action; Open, Close Events.