Access.2007.VBA.Bibl..

(John Hannent) #1
TABLE 14.5

USysRegInfo Rows Needed for a Property Builder


Subkey Type ValName Value


HKEY_CURRENT_ACCESS_PROFILE\Wizards\ 0
Property Wizards\Name\LNC Builder


HKEY_CURRENT_ACCESS_PROFILE\Wizards\ 1 Description LNC Rename Current Control
Property Wizards\Name\LNC Builder


HKEY_CURRENT_ACCESS_PROFILE\Wizards\ 4 Can Edit 1
Property Wizards\Name\LNC Builder


HKEY_CURRENT_ACCESS_PROFILE\Wizards\ 1 Library |ACCDIR\LNC Rename.mda
Property Wizards\Name\LNC Builder


HKEY_CURRENT_ACCESS_PROFILE\Wizards\ 1 Function LNCBuilder
Property Wizards\Name\LNC Builder


Strictly speaking, a library database contains add-ins (usually several), but usually the
entire library database is referred to as an add-in.

Things You Need to Know When Writing Add-ins ............................................................


There are several things to keep in mind when you attempt to write your own add-ins. Some are
pitfalls that can prevent the add-in from functioning, and others are recommendations for good
add-in design.

Special Requirements for Add-in Code ....................................................................


n When you run an add-in, the code is running from another database (the add-in library
database), and you need to take this into account when referencing database objects in
your code. If you want to use an object in the library database, use CodeDbto set a refer-
ence to that database; if you want to reference an object in the calling database, use
CurrentDb(both CodeDband CurrentDbare used in the Extras 2007 add-in code).
n Only functions can be run from the Registry; all the procedures referenced in the
USysRegInfo table must be functions, even a procedure that would normally be a Sub
(because it doesn’t return a value). However, other procedures used in the add-in library
database (the ones that are not run directly from the Registry, and are not referenced in
the USysRegInto table) can be subs.

NOTENOTE


Creating Access Add-ins 14

Free download pdf