Microsoft Access - Leverage Pre-Existing Code In A New Application (Access 97/2000/2002/2003)
When a project requires the same procedures you developed for a previous application, you can always copy the procedures or import their modules into the new file. You have another option if you work in an environment where you'll have continual access to the previously created files. You can simply set a reference to the MDB file that contains the code to gain access to its public procedures.
To set the reference:
- Open any module in your current database
- Choose Tools | References from the menu bar
- Click the Browse button and change the Files Of Type setting to Microsoft Office Access Database
- Locate and select the file, and then click Open
- The database name appears in the Available References list with a check beside it
- Click OK
From this point, you can use the functions and sub procedures from the original file as if they were stored in the current database.