B.3. Building Code Libraries

Aside from the four types of reference libraries listed above (OLB, TLB, DLL, and OCX), there is a set of "library" types that are often overlooked. These are library types you can use to link to Access projects you have created. They include:

  • MS Access Databases: MDB and MDE

    Figure B.3. Figure B-3
  • MS Access Add-ins: MDA

  • MS Access Projects: ADP and ADE

With these types of references you can develop your own Code Libraries that contain routines to share in all of your applications. An example might be something like a common Error Handling routine.

Since you can reuse these routines over and over, you can justify putting a little more effort into them. Take error handling for example. Commonly, we develop code to display a message to the user and request that the user report the error to us. Have you ever been watching a user use your application and expose an error you hadn't found in testing? They click OK on the message without giving it a second thought. You ask why they didn't wait to review the message and they say, "Oh, that happens all the time. I was told to just ignore it."

Suppose that instead of just depending on the users to call to report errors, you write routines to track the errors in a table. Then you could investigate what is happening. Perhaps your tables could even maintain some trace data to help find out what causes the problem. ...

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.