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

G.1. The Application Object

All of the Access objects you'll manipulate within code are children of the Application object, which is the parent object for all objects and collections in the Access object model. Every object and collection is related to the Application object through either a direct parent/child relationship or multiple parent/child relationships. Figure G-1 shows the Access objects and collections that are the direct children of the Application object. The Office 12.0 object library exposes objects from the Application object for each Office application. Because those objects are part of the Office object model, they aren't listed here.

The Application object refers to the currently active Access application. It contains all Microsoft Access objects and collections. You can use the Application object to apply methods or set properties for the entire Access application. For example, you can use the object's SetOption method to control just about all the settings visible in the Access Options dialog box. The various settings you can use with SetOption are listed a little later in this appendix. The following code displays hidden objects in the navigation pane:

Application.SetOption "Show Hidden Objects", True
Figure G.1. Figure G-1

Nearly all code you write in Access utilizes the Application object somewhere within the code.

G.1.1. Application Object Properties ...

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