<%dim crumb crumb="After Update Event" crumb1="VBA After Update" %> AfterUpdate 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

Access Event Tutorial - Afterupate

Form events offer you the power to control all aspects of the user interface including control over navigation, implementation of data integrity and validation procedures through visual basic event programming. Afterupdate event is triggered and the entire record is updated and the data is saved in the database when:

  • The control loses the focus

  • The user presses ENTER or TAB

  • The focus leaves the record

  • The user clicks Save Record on the Records menu

Access Event Tutorial - AfterUpdate VBA:

In this AfterUpdate event example we requery a grand total field on the master form after records are updated in the detail form:

Private Sub Form_AfterUpdate()
End Sub

Note: When validating form field values it is important to know that the OldValue property isn't set to the updated value until after the event for the form occurs.

If you decide to cancel the update the value of the OldValue property replaces the changed value in the control.

New with Microsoft Access 2010 are table level event procedures.  These events are defined in design view or datasheet view of the table.  You can create a macro run run code now for the After Update table event.  This new capability significantly extends the power and flexibility of Access 2010.

More AfterUpdate Examples & Discussion:

Current Value Previous Field Value

Access database calculations - compare old vs new form field values. ... Finally in the After Update event we have both the new and old values available for ...

Global Variables as Query Parameters

This is easily done by adding the following line of code in the After Update event... GBL_Project_ID=Project_Combo. In the query there's no more trying to ...

Inventory Database Multi-User Example

Private Sub Qty_Out_AfterUpdate()
Dim db As DAO.database ' note that we always use DAO database and recordset operations because we always use Microsoft Jet databases.

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" %>