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

5.1. VBA Objects

You can't program in VBA without understanding how the various VBA components work together. All VBA code is comprised of individual statements. Those statements take objects and manipulate their properties, call their methods, and perform their events. This section introduces the concepts of objects, properties, methods, and events.

VBA is an object-oriented programming (OOP) language. OOP is a type of programming in which programmers define a complete data structure from data types to the operations that can be applied to the data structure. Programmers can create an entire object that contains both data and the operations that the object can perform. They can also create relationships between objects.

There are seemingly countless objects that you can work with using VBA. The collection of objects exposed by a particular application is called an object library. You can incorporate multiple object libraries in VBA. For example, you can use VBA to manipulate the Access object library and work with objects such as tables, queries, forms, and reports. You can set references to other object libraries such as Microsoft Outlook, Adobe Acrobat, or Microsoft Word. (Appendix B provides an in-depth discussion of how to set and use references.) Every time you set a reference to another application's object library, you have access to all objects within that library. An object is generally thought of as a physical thing. For example, if you were to set a reference to a ...

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