Add data macros to a table event

Suppose you want to have Access take an action either immediately before or after you add, update, or delete data in a table, you can do it by adding data macros to the table event. While working with macros can seem a bit daunting at first, here are basic steps to get you started. Also, take a look at other macros topics available at the end of this article.

Note:  Use the following steps if you are working with a desktop database.

  1. Open the table, on the Table tab, click the event to which you want to add the macro. For example, to create a data macro that runs after you delete a record from the table, click After Delete.

Note:  When an event already has a macro associated with it, its icon appears highlighted.

Add event driven data macro

Access opens the Macro Builder. If a macro was previously created for this event, Access displays the existing macro.

  1. Add the actions that you want the macro to perform.

  2. Save and close the macro.

While the Macro Builder can help you create or edit a macro, if you haven’t used macros get an overview to macros or more about working with data macros. You might also like to find out about creating user interface (UI) macros.

Connect with an expert
Contact us
Expand your skills
Explore training

Was this information helpful?

Thank you for your feedback!

Thank you for your feedback! It sounds like it might be helpful to connect you to one of our Office support agents.

×