Table

The USysReglnfo Table Fields

Field Data Type Usage

Subkey Text The name of the Registry subkey where a specific Registry setting is stored; can be either HKEY_CURRENT_ACCESS_PROFILE or HKEY_LOCAL_MACHINE. For Access add-ins, the HKEY_CURRENT_ACCESS_PROFILE is preferable, because it automatically uses the Registry section for the running version of Access, allowing the same add-in to work in multiple Access versions.

Type Number The type of entry to create; can be key (0), string (1), or DWORD (4)

ValName Text The name of the Registry value

Value Text The value of the Registry value

If you create the USysReglnfo table from scratch, you will get an error when entering the name "Value" for the last field (as shown in Figure 14.6). This is because Microsoft has violated its own rules by giving a field a name that is a reserved word (in this case, a property name). However, you can save the field, and it does work. Don't change the field name, because each field in this table must have a specific name to work correctly.

FIGURE 14.6

An error when creating the Value field in the UsysRegInfo table.

FIGURE 14.6

An error when creating the Value field in the UsysRegInfo table.

If you copy the USysRegInfo table from another add-in, it has a default value of GenUniqueID() for the Type field, and also has some useful information in the Description column telling you the value needed for each field data type, as shown in Figure 14.7.

FIGURE 14.7

An imported USysRegInfo table with Description information.

FIGURE 14.7

An imported USysRegInfo table with Description information.

Each type of add-in requires a set of records in the USysRegInfo table, as described in the following sections. The Extras 2007 add-in that is the sample add-in for this chapter is a set of menu add-ins, which will be described in detail; for the other add-in types I will reference two add-ins that I created in earlier versions of Access.

You might think that add-ins would be found on the Add-Ins tab of the Ribbon in Access 2007 (this tab may not be visible if you are running Windows Vista). But this is not the case. Your Access add-ins are located on the Add-ins menu of the Database Tools tab. The Add-Ins tab has a set of menus like those in previous versions of Access, except that they don't work. The purpose of these non-functional menus is to display commands placed on the Access 2003 (or earlier) menus by add-ins working with the CommandBars collection. This is a very awkward method of implementing backwards compatibility; if you have such an add-in, you will probably want to redo it to place commands on various tabs of the Ribbon, as described in Chapter 15.

0 0

Post a comment