Learn Access 2003 VBA with The Smart Method
64
www.LearnAccessVBA.com
Lesson 3-4: Understand the
Access object model
About object hierarchies
We have already seen how a Car object can contain other objects (such as
a windscreen object).
Objects can also contain object collections of similar objects. In the earlier
example the Car object had a collection of Wheel objects. The wheel
objects did not necessarily have the same properties—for example there
may have been wider tyres fitted on the rear wheels.
Object models express the concept of a hierarchy evident in May Louise
Cooper’s observation above. Each of her bugs is connected to another
bug higher up in the hierarchy.
The Car object model
Before considering the Access object model let’s consider the Car object
model that we’ve been discussing. Here it is:
A Car object contains a Windscreen object and a collection of Wheel
objects.
Greater bugs have little bugs
Upon their backs to bite ‘em
Little bugs have lesser bugs
And so on ad infinitum
May Louise Cooper, “Friendly Beetles", (1916)
Session3
pg_0002
Session Three: The Object-Orientated Paradigm
© 2007 The Smart Method Ltd
65
Each wheel object contains a Rim object, and a Tyre object.
Each Rim object contains a collection of WheelNut objects.
The Access object model
The Access object model contains a little over fifty objects. We’re going to
ease you gently into the model by introducing new objects as we use
them during this course. We’ve already identified three of the most
important objects.
Here’s the object model as we know it so far :
Microsoft always name collections in the plural and single objects in the
singular. It is thus obvious that the Forms item in the above diagram is
actually a collection of Form objects.
From the object model above it is clear that :
One Application object may contain zero, one or more Form objects.
Each Form object may contain zero, one or more Control objects.
Microsoft’s object model diagram
If you type Access Object Model into the help dialog you’ll be able to view
the entire Access object model.
Microsoft use color coding to indicate collections of objects, and there’s a
few objects that you might not recognize, but from what you have
learned in this section, and your existing Access skills, you will be able to
understand the purpose of many of the objects.
.