So far, all the code you have written works only from within the database where you created it. There may be times when you want to reuse code across multiple Access projects, such as when performing a common task that multiple databases might need to perform. You can create libraries based on a specific Access databases that can then be referenced from and used by other Access databases. However, in order to be a good candidate for a library, the database should contain only generic procedures and functions, and not specific references to forms or other objects that may not be present in the other applications or databases from which the library might be used.
Try It Out: Creating and Using a Code Library
In this example, you will create a new Access database containing a sample error-handling procedure that you will make available to other Access databases. This error-handling procedure was described in Chapter 2. You will add the new database as a Library and then use the Library from another database.