The primary way to trigger user-initiated macros is through an event called OnClick in a button control object. In this video, Access database expert Adam Wilbert shows how to connect a prewritten macro to a button. He also shows some of the many additional triggering events that are available in Access objects.
- [Narrator] In order for a macro to begin running…it needs to be triggered.…So far we've done this by double clicking…on the name of the macro in the navigation pane…of the database.…And while that will work.…It's not the best way for users to trigger a macro.…A better option is to link the macro to some event…in the interface that you've developed for your database.…So just pressing a big unambiguous button on a form.…Let's go through the process of adding a button…to initiate our morning review macro.…I'm going to take the Main Menu form…that I have open up here.…And I'm going to switch it over in to design view.…Then in the Design tab in the Controls group.…
I'm going to click on the button control.…Which is this one here with the rectangle and the four Xs.…Again click it once to select it.…And then come down into my form…and click again to add in a button.…That'll start up the Command Button Wizard.…In the wizard we're prompted to select…an action that we want to perform.…And all these will create a macro.…
- Creating multi-step macros
- Triggering macros
- Running macros at startup
- Adjusting the execution and flow of macros
- Troubleshooting macros