Microsoft Access 2010 Bible

(Rick Simeone) #1

Part II: Programming Microsoft Access


566


FIGURE 15.9

A typical log table updated with an AfterInsert data macro


The AfterInsert data macro runs whenever a record is added to the table. Similar data macros
can be added to the table’s AfterUpdate and AfterDelete to log other changes to the table.
You’ll notice that tblProductActivityLog includes a text field named ProductActivity
containing different changes (Insert, Update, Delete) occurring to the table.

Building Macros


You’ve seen several pictures of the Macro Designer, but let’s take a closer look at how data blocks
and macro actions are added to the design surface, and explore some of the options for managing
macro objects once they’re added to a macro’s design.

Adding macro items
Program-flow items, data blocks, and macro actions are added to the design surface by double-
clicking their entry in the Action Catalog, or by dragging them from the Action Catalog onto the
macro surface.
Free download pdf