Access.2007.VBA.Bibl..

(John Hannent) #1
FIGURE 14.9

Entering the add-in’s identification information in the properties sheet.


Troubleshooting Add-ins ..................................................................................................


If you need to step through add-in code to determine what is causing a problem, you have two
options. One is to place a Stopstatement in the add-in code, which will stop the code at that point
when it is executing, so you can step through the code from that point. To do this, you must first
close any open database, then open the add-in library database and add the Stopstatement, save
and close the add-in, then open a database and run the add-in that has the Stopstatement in its
code. Later, you will need to remove the Stopstatement from the add-in code in a similar fashion.

The other (and quicker) alternative is to set a reference to the library database, so you can open its
code modules and place breakpoints, and even modify the code temporarily, to test various alterna-
tives. To set a reference to an Access add-in library database, complete the following steps:

If you plan to set a reference to a library database so you can step through its code eas-
ily (as described next), give its Visual Basic project a meaningful name, so it will say
“Extras” (or whatever) instead of “Project1” in the References dialog. To name the VB project, open
the Visual Basic window, select the project row (the top row) in the Project Explorer, and rename it in
the Name property of the properties sheet, as shown in Figure 14.10.

TIPTIP


Creating Access Add-ins 14

Free download pdf