A.11. Chapter 11

  1. A standard library can be added using Tools References. You can then work with the objects of that library from within your code and have full access to the available properties, methods, and events as you type your code. An external library is more complicated to work with and requires an explicit declaration in the General Declarations section, as well as a procedure call from within your VBA code. External libraries must be declared with the exact syntax, or an error will occur.

  2. Automation allows one application to control another application, such as Access controlling Word. You can use automation to create new Excel spreadsheets, to create new Word documents, or to manipulate Outlook objects such as e-mails, contacts, and calendar entries. These are just a few examples of using automation. In order to use automation, you must add a reference to the library that corresponds to the application you want to control.

  3. A code library can be created by simply creating a new Access database that contains the code you want to have reused by other applications. Code libraries are a good idea for storing generic code that multiple applications might want to take advantage of, such as error-handling routines. Instead of copying the same procedures into every application and then having to update multiple locations, you can simply point each application to a single Access ...

Get Beginning Access™ 2007 VBA 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.