Microsoft Access 2010 Bible

(Rick Simeone) #1

Part IV: Professional Database Development


852


Caution
Any library procedures declared as Private are not accessible to the calling application, so carefully plan what
you want to expose (declare as Public) and don’t want to expose to other databases.


After you create the library database, you have to reference it in the application database (which is
the database that your users will run). To create a reference, first open any module in your applica-
tion in the VBA editor. With a module open in Design view, a new command — References — is
available on the Tools menu (see Figure 24.5). Select the References command to open the
References dialog box (see Figure 24.6).

FIGURE 24.5

The References option appears on the Tools menu only when you have a module open and selected in
Design view and no code is currently running.


FIGURE 24.6

The References dialog box is where you reference different types of libraries.


When making a reference to another Access database you may need to browse for the database.
After you’ve selected the external Access database, it shows up in the References dialog box with a
selected check box to indicate that it’s referenced.

To remove a reference, open the References dialog box again and deselect the referenced item by
clicking its check box. After you’ve made all the references that you need to make, click OK.
Free download pdf