O'Reilly logo

Access™ 2007 VBA Programmer's Reference by Armen Stein, Geoffrey Griffith, Rob Cooper, Teresa Hennig

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

In addition to the four types of reference libraries (OLB, TLB, DLL, and OCX), a set of library types is often overlooked. These types include:

  • MS Access databases: ACCDB, ACCDE, MDB and MDE

  • MS Access add-ins: ACCDA and 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.

Because you can use these routines over and over, you can justify putting a little more effort into them. Take error handling, for example. Generally, you develop code to display a message to the user requesting that the user report the error to you. Have you ever seen a user use your application and expose an error you hadn't found in testing? He clicks OK on the message without giving it a second thought. You ask why he didn't wait to review the message, and he says, "Oh, that happens all the time. I was told to just ignore it."

Suppose that instead of depending on the users to call in 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 discover what causes the problem. Suppose you also realize that the main reason errors don't get reported is that it is too difficult for the user to report them. So you add some functionality that builds an e-mail message for the user to send through ...

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