To create an event procedure that runs when the BeforeInsert or AfterInsert event occurs, set the BeforeInsert or AfterInsert property to [Event Procedure], and click the Build button .
Syntax
Private Sub Form_BeforeInsert(Cancel As Integer)
Private Sub Form_AfterInsert( )
The BeforeInsert event procedure has the following argument.
Argument | Description |
---|---|
Cancel | The setting determines if the BeforeInsert event occurs. Setting the Cancel argument to True (–1) cancels the BeforeInsert event. |
Remarks
You can't cancel the AfterInsert event.