<%dim crumb crumb="After Insert Event" crumb1="VBA AfterInsert" %> AfterInsert Event
Home   Fees/Services   Access Templates   Tutorials  Tutorial Downloads   Articles   Search   Contact  Privacy  Links
<% response.write crumb2 %>
<% response.write crumb1 %>
 Home > Microsoft Access Tutorial > Form Event Tutorials <% response.write "> " & crumb %>

Access Event Tutorials:
Before Insert Event
After Insert Event
After Update Event
Before Update Event
Change Event
Close Event
Current Event
Double Click Event
Error Event
Exit Event
VBA Timer Event
Undo Event

Table-Level Events

AfterInsert Event Access

VBA Form Event Examples - Visual Basic Code Samples

AfterInsert event occurs in VBA after a new record has been added to the source table of the form.

AfterInsert Event Example:

Here we popup a message to the user when a new record is inserted:

Private Sub Form_AfterInsert()
  MsgBox "The new employee record has been created"
End Sub

Or, requery a combo box after a new entry has been inserted:

Private Sub Form_AfterInsert()
End Sub

In Access 2010 Microsoft has extended Access's capability by adding several events to the tables.  The new after insert table event gives you the ability to create a macro to run when a record is inserted into a data table.  We use this to insert result records in a master detail table relationship.

Try a running after insert event example here:

Inventory Calculations Example with After Insert Event
Recently added to this demo are complex form footer sum calculations and an example of an after insert (afterinsert) event procedure. ...

See the Related BeforeInsert Event in Microsoft Access



Form Triggers
Table Triggers
Form Flags
Table Triggers
Record Flags
Record Events

Microsoft Office:
MS Access 2003
Access 2007
Access 2010
Access 2013
Access 2016

Contact Information

<% Response.write "Copyright 2000-" & year(now) & " Blue Claw Database Design" %>