Learn Access 2003 VBA with The Smart Method
106
www.LearnAccessVBA.com
Lesson 5-9: Use the help
system and the object browser
The Visual Basic help system can provide all of the information you need
about both the Visual Basic programming language and the Access object
model. This session will teach you how to quickly find help on any topic.
Getting help using the Visual Basic help system
1
Open the code editor and click on the object name
Err
in the
error handler for the cmdAddTwoNumbers event handler.
2
Press the F1 key.
The Help system starts and displays information about the Error
object. Links are also provided to list the object’s properties and
methods.
Getting help using the Object Browser
The object browser provides a quick reference to all of the objects in the
Access object model. Each object’s Properties, Methods and Events are also
documented.
1
Open the VBA editor.
2
Open the object browser by either pressing the <F2> key, by
selecting View Object Browser from the menu, or by
clicking the Object Browser button
on the standard
toolbar.
3
Select
Access
from the drop down list in the top left corner of
the Object Browser.
4
Type
CommandButton
(no spaces) in the search box
beneath the drop down list.
5
Click the Search button
.
Session5f
pg_0002
Session Five: Professional Grade VBA
© 2007 The Smart Method Ltd
107
The Search Results pane shows the objects found with the best
guesses at the top.
You can click on any of the objects in Search results (or select
directly in the Classes pane) to see all properties, methods and
events of the chosen object type.
6
Select the
Command Button
object in the top pane and
browse all of its Properties, Methods and Events.
Properties are marked with the
icon, Methods with the
icon and Events with the
icon.
7
Obtain detailed help on the Command Button’s
Click
event.
Scroll down the list of Properties, Methods and Events until you
find the Click event.
With the Click event selected click the yellow question mark icon
at the top of the dialog.
The help system displays detailed help for the Command Button’s
Click event.
note
The terminology Class and
Object refer to almost the same
thing.
A Class is the actual definition
of the object. Think of it as the
mould from which all new
objects are made.
One Class can be used to create
any number of Objects.