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

9.7. Summary

every procedure you write in Access VBA should have error handling. Keep error handling simple and easy to implement, with one basic copy-and-paste code block. Then do a few quick steps if necessary to adapt the error handling to your procedure:

  • Change Exit Function to Exit Sub if the procedure is a sub.

  • Add code to quietly absorb expected errors, if any.

  • Make sure you perform any necessary cleanup if an error occurs.

By following these error-handling guidelines, you'll build VBA code that is easier to debug and maintain, so you can focus on building great features into your application.

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