Home   Fees/Services   Access Templates   Tutorials  Tutorial Downloads   Articles   Search   Contact  Privacy  Links

Access 2010 Table Triggers





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

New...
Table-Level Events


Table Events

Table events were added the Microsoft Access with version 2010.   These events provide a database-wide method to perform procedures in one central location.  Therefore for many events you don't need to put them in the form code which may have to be called as a procedure from several forms.



Are you just starting out on your quest for a small business database? Need some advice or someone to bounce ideas off of? We are happy to chat with you to discuss options to your situation.

Are you looking for an MS Access template database? We have many for sale in our Access Template and Examples Software section.


The only drawback that we see with the table level events is that you must code them using the Macro language.  Note that your database must be in .accdb format and not in .mdb format!

Here is an image of the table design screen for table events:

Access Table Level Triggers

< In this example we will create a simple audit trail for our table M_Equip_Meter_Reads.  And, specifically for the field Meter_Value.

Here is the event macro for a little audit trail on the Meter Value field:

before update change delete event

Access monitors when the Meter_Value field has changed as part of the cascading events in the system.  Once the value changes the database macro sets up the audit fields with the values needed.  The source of the data for each of these fields varies and includes fixed text values, such as the table name "M_Equip_Meter_Reads", a special field value which is the field value before it gets updated ( [Old] ), also a special user define function which determines the current user on the computer.  Here is the function code:

I tried putting Environ function directly in the macro but it didn't work.

Here is the table M_Equip_Meter_Reads that we are going to update:

event macros for microsoft access

When we change a meter value in the table it generates an audit record in the audit table showing the original (old) value and the new value:

after update before update event

 We have recently create an example and tutorial on how to create an audit trail in Access Forms.   See out forms based audit trail.




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



A Blue Claw Database Design Template:

Prescription Assistance Plan Admin Template
 








A Blue Claw Database Design Article:

ODBC Links To Other DB Systems
 











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


Contact Information

Copyright 2000-2017 Blue Claw Database Design