Access.2007.VBA.Bibl..

(John Hannent) #1
In a menu add-in, the function called from the add-in is preceded by an equals sign; in a
wizard add-in, there is no equals sign.

Property Builders ....................................................................................................


My LNC Rename add-in (originally created in Access 97 and updated for Access 2000) is still use-
ful in Access 2007 running on Windows XP, because Microsoft has not yet implemented automatic
object and control naming according to a naming convention. This add-in lets you automatically
rename database objects and form and report controls according to the Leszynski Naming
Convention. It includes several menu add-ins and two property builders, which run from the
Name property of a control (for renaming a single control) or the Detail section of a form or report
(for renaming all controls in a form or report).

For more details on the LNC Rename add-in, see my book Expert One-on-One Microsoft
Access Application Development(ISBN: 0764559044).

Property builders require five rows in the USysRegInfo table, as described in the following list:

n In the first row of the add-in, the Subkey field (which is the same for all the add-in’s
rows) has the Registry key information, referencing the Property Wizards section under
the HKEY_CURRENT_ACCESS_PROFILE key (which references the currently running
version of Access), and ending with the command name to display on the Add-Ins menu,
with an ampersand if desired to make a hot key. The Type field has a value of 0, indicat-
ing the start of a new add-in. The ValName and Value fields are blank.
n In the add-in’s second row, the Type field has a value of 1, the ValName field has the value
“Description”, and the Value field has text to display on the Builder dialog — in the case
of the LNCBuilder property wizard, that is the Choose Builder dialog opened from the
Name property of a control’s properties sheet.
n In the add-in’s third row, the Type field has a value of 4, the ValName field has the value
“Can Edit”, and the Value field has a value of 1, indicating that the wizard can be called
for an existing object.
n In the add-in’s fourth row, the Type field has a value of 1, the ValName field has the value
“Library”, and the Value field has the location and name of the library database, using the
|ACCDIR\ placeholder to point to the AddIns folder.
n In the add-in’s fifth row, the Type field has a value of 1, the ValName field has the value
“Function”, and the Value field has the name of the function to run (without an equals
sign).

Table 14.5 lists the USysRegInfo rows for the property wizard for renaming a single control from
the LNC Rename add-in.

CROSS-REFCROSS-REF


NOTENOTE


Part III Adding More Functionality to Office

Free download pdf