O'Reilly logo

Microsoft® Access® 2010 Programmer's Reference by Jerry Dennison, Geoffrey L. 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

Chapter 7. Using VBA in Access

WHAT'S IN THIS CHAPTER?

  • Using events

  • Employing good practices with VBA procedures

  • How to evaluate expressions in VBA

  • Using recordsets

  • Using multiple recordsets

  • Coding behind forms and reports

  • The VBA debugging environment

  • Determining the value of variables

  • Handling common VBA challenges

  • Concatenating strings

  • Handling VBA errors

In the early days of programming, procedural languages ruled, meaning that the overall program execution was very structured and code was generally run in a very specific order. The main body of any of these programs had to cover every possibility: Display a screen to the user, gather input, perform edit checking, display messages, update the database (or simple files in those days), and close when everything was done. The main program also had to deal with every option or side request that the user might make. This made it difficult to understand the entire program, and it was tough to make changes because everything had to be retested when a modification was made. Those lumbering beasts included FORTRAN, COBOL, RPG, Pascal, and earlier forms of Basic. Millions of lines of code were written in these languages.

Fortunately, those days are over for VBA programmers. VBA is an event-driven language. In every Access form and report, a variety of events are waiting for you to use. They are available when the form opens and closes, when records are updated, even when individual fields on the screen are changed. They're all there at your fingertips. ...

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