Access VBA Macro Programming

(Joao Candeias) #1

By default, the Object Browser references two separate object models. This is Access and
DAO. The Access object model references the application itself, using collections such as
Forms and Reports, and the DAO object model is pointed at the use of the data itself and uses
objects such as TableDefs and QueryDefs.
You can search on specific strings by entering your search string into the box underneath
the pull-down showing and then clicking the binoculars symbol or pressing
ENTER. For example, you may want to know which parts of the DAO object model deals with
QueryDefs. Simply typeQueryDefinto the Search box, click the binoculars symbol, and you
will see all references containing the wordQueryDef.This is far easier than investigating
each hierarchical structure, which could take some time.
You can click a class (which is an object) to see all the properties, methods, and collections
underneath it. If you have searched on the wordQueryDef, click the Class QueryDefs (which
is the actual collection of all queries) and examine the methods and properties available in the
Members box to the right of the class. Methods have a green icon, and properties have a gray
icon with a hand holding it.
Clicking a property will show whether a property is read-only or if you can write to it.
It will also show the object that owns it. The pane at the bottom of the Object Browser will


Chapter 14: The Access Object Models 185


Figure 14-3 The Access object model in the Object Browser

Free download pdf