Presentation is loading. Please wait.

Presentation is loading. Please wait.

DB Implementation: MS Access Macros

Similar presentations


Presentation on theme: "DB Implementation: MS Access Macros"— Presentation transcript:

1 DB Implementation: MS Access Macros

2 Programming in MS Access
Modules An organized collection of Visual Basic for Application (VBA) code More flexible and powerful than macros, but less secure Macros A named set of actions that perform operations/tasks e.g. open/close a form, print a report, set value of a control Tool to automate tasks and extend functionalities without programming Macro actions/functions = subset of commands available in VBA Command Button Wizard To perform Common Tasks Macro Builder Build a list of actions to perform by selecting from list of actions Database Design

3 Access Macros: Elements
Event The reason the macro “fires” or runs. i.e., the trigger for a macro execution e.g., a form control gaining/losing focus, mouse click/movement Action What the macro does e.g. load/close/delete object, set field/control value Action Arguments (properties) What action applies to e.g. frmEmployee Conditions Conditions that must be true for the macro to run e.g. IsNull(Forms![frmEmployee]![Status]) creation: CUSTOMER table multi-table query: PRODUCT+SUPPLIER qrySensless, qrySensible Database Design

4 Access Macros: Events Event is the reason the macro “fires” or runs.
A macro’s execution should be triggered by a specific event Successful macro use depends on attaching to appropriate events good macro design. Example After Update vs. Lost Focus event loss of focus can occur without data entry or edit for data entry trigger, use “After Update” event Associating Events and Macros Set the appropriate Event Property of the control to the name of the macro that will perform desired actions. creation: CUSTOMER table multi-table query: PRODUCT+SUPPLIER qrySensless, qrySensible Database Design

5 Access Macros: Grouping
Simple/Embedded Macro A single macro Actions are executed sequentially from top to bottom Macro Group Related macros grouped together in a macro object Individual macros in a macro group are referenced by MacroGroupName.MacroName e.g. mcrOpenCloseGRP.CloseImOpen S511 Session 9, IU-SLIS


Download ppt "DB Implementation: MS Access Macros"

Similar presentations


Ads by Google