O'Reilly logo

Access 2013 Bible by Dick Kusleika, Michael Alexander

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

Chapter 26: Debugging Your Access Applications

IN THIS CHAPTER

Organizing VBA code

Testing an application

Debugging the traditional way, with MsgBox and Debug.Print

Taking advantage of the debugging tools available in Access

Trapping unexpected errors

Many Access applications rely on significant amounts of VBA code in forms and reports, and as stand-alone modules. Because of its power and flexibility, VBA is used for all aspects of application development, from communicating with the user to massaging and transforming data on its way from tables and queries to forms and reports.

Because VBA code is often complicated (or at least, seems complicated!) debugging an error or problem in an application can be difficult and time-consuming. Depending on how well organized the code is, and whether simple conventions, such as providing descriptive names for variables and procedures, were followed, tracking down even a small coding bug can be a frustrating experience.

Fortunately, Access provides a full complement of debugging tools to make your life easier. These tools not only save time by helping you pinpoint where a coding error occurs, but can help you better understand how the code is organized and how execution passes from procedure to procedure.

Note

This chapter largely ignores the errors caused by poor design — misrepresentation of data caused by ill-designed queries, update and insert anomalies caused by inappropriate application of referential integrity rules, and so on. For ...

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