B.2. Adding References to Your Projects

As noted above, adding references to libraries from your Access project can allow you to quickly enhance the functionality of your application with less coding effort. The types of type or object libraries that Access can reference include:

  • Type libraries: OLB, TLB, and DLL

  • ActiveX Controls: OCX

You have seen that you can automate Office applications by adding a reference to one of the libraries that comes with Microsoft Office, for example, Microsoft Office 11.0 Object Library. Here are the steps necessary to add a reference, as well as what it means when you do.

Open the Visual Basic Editor and select Tools | References. This will display the References dialog box as shown in Figure B-1.

The items listed in the Available References list include items that have been registered to the Windows System Registry. To add one of these libraries to references for your project, check the box to the left of the library. When you close and reopen the References dialog box, any libraries you have checked will move above all unselected libraries.

Figure B.1. Figure B-1

NOTE

The order of the libraries you have selected is important. See section Order of References Is Important later in this appendix.

Many application installation packages will handle registering libraries for you. If the application you install does register the library you want, there ...

Get Access 2003 VBA Programmer's Reference now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.