Creating Installable 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.
You can create add-ins that the user can load (install) or unload (uninstall) by using the Add-In Manager. The Add-In Manager can load the following types of add-ins:
- Menu add-ins, such as those described in Creating Menu Add-ins for Access.
- Object wizards, which help the user create a new table, query, form, data access page, or report. Microsoft® Access includes a number of built-in object wizards, which are available in the New Table, New Query, New Form, New Data Access Page, and New Report dialog boxes. An object wizard that you create also will appear in one of these dialog boxes.
- Control wizards, which help the user to add either an Access control or a Microsoft® ActiveX® control to a form, report, or data access page. A control wizard runs only if the Control Wizards tool in the toolbox is depressed. When this button is depressed, clicking a control in the toolbox and dropping it onto a form, report, or data access page launches the wizard that is associated with that control.
- Builders, which help the user to set a property for an object in the database — usually through a dialog box. When a builder is available for a particular property, the Build button (the small button with the ellipsis […]) appears next to that property's name in the property sheet.
To load or unload one of these add-ins, the Add-In Manager relies on the presence of a table within the add-in, called the USysRegInfo table. The USysRegInfo table provides information that the Add-In Manager writes to the registry. Access uses this registry information to launch the add-in in response to an action taken by the user.
Note The USysRegInfo table is a system table and usually is hidden. To view system tables, click Options on the Tools menu, click the View tab, and then select the System objects check box.
You must create the USysRegInfo table; it is not created for you automatically when you create a new .mda file. The USysRegInfo table must contain the four fields described in the following table.
|Subkey||Text||The name of the subkey that contains the registry information for the add-in|
|Type||Number||The type of value to create beneath the subkey: subkey (0), String (1), or DWORD (4)|
|ValName||Text||The name of the registry entry to be created|
|Value||Text||The value to be stored in the registry entry defined by the ValName field|
Each record in the USysRegInfo table describes a subkey or value that is to be added to the registry for a particular add-in. The table can contain information for multiple add-ins.
For each add-in, the USysRegInfo table must contain a minimum of three records: one to create the subkey for the add-in, one to add the Library entry, and one to add the Expression entry. Note that these are the same values required to create a menu add-in, as described in the previous section. You can add other records to store additional values in the registry. For example, you might add a record that creates a registry entry that indicates where a bitmap file required by the add-in is stored.
In the Subkey field, you can use the HKEY_CURRENT_ACCESS_PROFILE\AddInType\AddInName string to create the new registry entry. The Add-In Manager uses this string to determine the location on the user's machine of Access-specific information in the registry, so Access can create the entry for the add-in in the appropriate place. If the user started Access with the /profile command-line option, this string makes sure the registry entry is created beneath the specified Access user profile; otherwise, the entry is created under the \HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\2002\Access\AddInType subkey in the registry. For more information about starting Access from the command line with the /profile option, search the Microsoft Access Help index for "user profiles."
**Note **A user profile that you use to start Access from the command line is not the same thing as a user profile that is defined for logging on to the operating system. An Access user profile applies only to Access, and only when you start Access from the command line. A user profile defined for the operating system applies to every application on the system and is used to maintain system data for individual users.
You can also use the HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\2002\Access\AddInType string to specify that the registry entries for the add-in always should be created under this registry subtree and that Access user profiles are to be ignored. Note that in this case you must include the full registry path to the add-in's subkey.
Sample USysRegInfo Table