O'Reilly logo

Access 2003 VBA Programmer's Reference by Armen Stein, Graham Seach, Teresa Hennig, Patricia Cardoza

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required