16 min read
Attaching Macros to Buttons and Events
A macro does nothing on its own until something triggers it — a button click, or a form's On Load event, wired through a control's Property Sheet.
Field Notes: Wiring a Macro to an Event
Goal
Trigger a saved macro from a button click or another event.
Nearly every control, and every form or report itself, has event properties that can run a macro automatically.
Select the control and open its Property Sheet
Do this
Verification
Check your work
You are correct if all of these are true:
- Whenever that event occurs — the button being clicked, for example — Access automatically runs every action in the attached macro, in order, with zero further effort on the user's part.
Rather than creating a separate, named, reusable macro object, you can also click directly into an event property, like On Click, and choose "[Embedded Macro]" to build a one-off sequence of actions that lives entirely within that single control — useful for simple, single-purpose actions you'll never need to reuse elsewhere.
More lessons in Microsoft Access · Next: The Navigation Pane and a Navigation Form · Previous: Building a Macro with the Macro Designer
