Follow Us

External References for MS Access

It is not uncommon for more than one MS Access database to be used in a single workplace. I have several that I use in my own business as an Access and Web developer. When I develop a new database, I hate re-writing or even copying and pasting all the simple functions that I use all the time - functions I have written to make my life easier such as Replicate(), VBIn(), VBBetween() and ErrMsg() that I use in nearly every database I create. It becomes even more irritating to copy and paste the not-so-simple ones that require importing entire modules of code, API declarations, and global variables.

What I have done instead is create a database with all these functions already in it, then make a reference to it using the Tools==>References dialog in the VBA Project window. I just click the Browse… button and navigate to the location where I have my Functions.accdb database and click OK. Done! All my functions are now ready to use in my new database.

A tip for when your database won’t compile is to check those references. Especially when you use Office automation (integration with Word or Outlook), references to functions in those project libraries can be useful, but links can also get confused – especially if you move your application to another computer. Open the dialog and look for any x’s next to your available references. If your application breaks when moving to a different computer, the referenced library may be in a different location. For example, if you moved from a system with a 32-bit Office installation to another with a 64-bit Office installation, the files would not be properly referenced.

Page 3 of 3

HostGator Web Hosting
RoboForm: Learn more...