Using an Autoexec Macro in Access 2010

by rhyttinen on December 22, 2010

If you're new here, you may want to subscribe to my RSS feed. Thanks for visiting!

We continue our discuss of Access 2010 Macros this week by looking at the AutoExec macro. An AutoExec macro is a macro that automatically executes when you open a database. For instance, you may wish to display a particular form when the database is opened or perhaps display an informational message to your user. One of my favorite uses for this macro is to hide the Navigation Bar and then display a Switchboard form.

To create an AutoExec macro, create a macro as you would any other but name it: Autoexec.

Note that an AutoExec macro will run after the Startup Options have taken effect; therefore, you should avoid any actions in your AutoExec macro that will change the effect of the Startup Option settings.

Saving an AutoExec Macro in Access

The AutoExec macro executes when a database is opened

To Create an AutoExec Macro

  1. Click the Create tab on the Ribbon.
  2. Click the Macro button on the Macros & Code group on the Ribbon.
  3. Click the drop-down arrow on the Add New Action drop-down list and choose the action from the list that you want the macro to carry out
    Or
    Double-click the action you wish to use in the Action Catalog (click the plus or minus signs to expand or collapse the Actions groups)
    Or
    Drag an action from the Action Catalog to the Macro window.
  4. In the lower part of the window, enter any arguments for the action, if required.
  5. To add more actions to the macro, move to the next blank Add New Action drop-down list and repeat steps 3-5 (Access executes the macro actions in the order that they are listed in the action column).
  6. Click the Save button and then name your macro AutoExec. Make sure that any actions in your AutoExec macro do not change the effect of the startup option settings.

Applies to Microsoft Access 2010

Similar Posts:

Share and Enjoy:
  • del.icio.us
  • Digg
  • TwitThis
  • Reddit
  • Technorati
  • Facebook
  • StumbleUpon
  • Google Bookmarks
  • Propeller
  • email

Comments on this entry are closed.

Previous post:

Next post: