O'Reilly logo

Access™ 2007 Bible by Gavin Powell, Joseph C. Stockman, Jennifer Reardon, Michael R. Groh, Michael R. Irwin, Cary N. Prague

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 10. VBA Programming Fundamentals

IN THIS CHAPTER

  • Converting macros to VBA

  • Using the Command Button Wizard to create VBA code

  • Understanding the basics of VBA

  • Understanding modules

  • Creating a new module

  • Using the Module window

If you have created or worked with a simple Access application, you most likely created the application's operations by using macros. Although macros provide a quick and easy way to automate an application, writing Visual Basic for applications (VBA) modules is the best way to create applications. Using data access, repetitive looping, and branching, and adding features that macros simply cannot provide gives you more control over application development. In this chapter, you learn how to build an application framework and how to extend the power of an application using VBA.

Note

Use the database file Chapter10.accdb in this chapter.

Understanding the Limitations of Macros

For a number of reasons, this book does not extensively cover Access macro creation. To begin with, there are enough important topics so that we have to choose which topics are covered in detail. Also, macros are pretty easy to learn on your own, and they are quite well documented in the Access online help.

But, by far, the biggest reason not to document macros is that, for the most part, macros do not belong in professionally built applications. At the very least, macros occupy a relatively minor position in most applications because of their rather serious limitations. Perhaps the greatest issue ...

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