Datasheet

616
3. Build your business logic using the Action Catalog.
4. On the File tab, click Save to save your macro.
The macros that you create appear under the Macros in the navigation tree.
Figure 1-5:
You can
drag
and drop
conditions
and actions
from the
Action
Catalog.
Data macros
Data macros are new with Access 2010 and allow you to add logic that is trig-
gered when specific events occur on a table — such as adding, updating, or
deleting data.
Data macros don’t appear under the Macros command in the Access naviga-
tion pane. Instead you can find them by selecting a table in your database
and then clicking the Table tab from the Ribbon menu. The Table tab gives
you access to a number commands that allow you to create data macros:
Before Change: Allows you to create logic that runs before a change is
committed to the database. You can use this event to validate changes
before saving them to the table.
Before Delete: Allows you to create logic that runs before deleting a
record. You can use this event to validate the delete function, or to
cancel the deletion and raise an error.
After Insert: Allows you to create logic that runs after a record has been
added to the table.
Designing SharePoint-Compatible Access Databases
31_587164-bk04ch01.indd 61631_587164-bk04ch01.indd 616 9/30/10 8:09 PM9/30/10 8:09 PM