Share via


Creating Menu Add-ins for Access

This content is no longer actively maintained. It is provided as is, for anyone who may still be using these technologies, with no warranties or claims of accuracy with regard to the most recent product version or service release.

The simplest Microsoft® Access add-in is a menu add-in. A menu add-in calls a procedure in another database, perhaps a database that is serving as a code library. For example, a simple menu add-in might call a procedure that generates a report containing information about the various objects in the current database, such as the date they were created and their descriptions. Menu add-ins appear when you point to Add-Ins on the Tools menu.

To create a menu add-in

  1. Add a subkey to the registry that specifies the name of the file containing the procedure and the name of the procedure itself. Menu add-ins are listed beneath the following subkey in the registry:

    \HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\Access\Addins\Menu add-ins

  2. To specify the command that should appear on the Add-Ins submenu of the Tools menu, create a new subkey beneath the Add-In's subkey. For example, naming this subkey &Analyze Database Objects would result in a command named Analyze Database Objects on the Add-Ins submenu.

  3. To hook up the menu command to the add-in, add two entries (in this case, String values) beneath the command's subkey, one named Expression and one named Library. Set the value of the Library entry to the path and file name of the database that contains the procedure that provides an entry point to the add-in. Set the value of the Expression entry to the name of the procedure itself. For example, if the procedure is named AnalyzeDatabaseObjects and it resides in a database named CodeLib.mda, you would set these entries as follows:

    Expression: "=AnalyzeDatabaseObjects()"

    Library: "C:\Windows\Application Data\Microsoft\AddIns\CodeLib.mda"

After you have added these keys, the new add-in command will appear on the Add-Ins submenu of the Tools menu the next time you open Access.

Note   If you must distribute your Access menu add-in to users, create an installable add-in, so the add-in is properly registered on users' machines.

See Also

Access Add-ins | Creating Installable Add-ins for Access