Using the Object Browser

Every object library provides VBA with a very large set of names that represent objects that VBA can manipulate . . . so many names that I doubt anybody would even attempt to remember them all. To make it easy to find names of things on an as-needed basis, VBA provides the Object Browser tool.

In this context, browser has nothing to do with the Internet or the World Wide Web. Rather, the Object Browser is a tool for browsing the contents of all available object libraries. And those object libraries have no connection to the Internet.

While you're in the Visual Basic editor, you can do any of the following to open the Object Browser:

I Choose ViewOObject Browser from the Visual Basic editor menu bar. I Press F2.

I Click the Object Browser button on the VBA editor's Standard toolbar.

When the Object Browser opens, it won't look like any big help, but there will be plenty of times when you need to use it. Now is a good time to become familiar with how you work that darn thing. Figure 2-9 points out the names of various tools within the Object Browser. A brief description of each tool follows.

References - VBA Practice m

Available References:

0 Visual Basic For Applications 0 Microsoft Access 11,0 Object Library 0 OLE Automation 0 Microsoft DAO 3.6 Object Library

0 Microsoft Active!-: Data Objects ¿.1 Librae i

□ IAS Helper COM Component 1.0 Type Librai

□ IAS RADIUS Protocol 1,0 Type Library

□ Acrobat Access 2,0 Type Library

□ AcroIEHelper 1.0 Type Library

□ Active D5 IIS Extension Dll

□ Active DS IIS Namespace Provider

□ Active DS Type Library

□ Active Setup Control Library

1 I ArhveMnvifi rnntrnl hvne lihrarv < JIM_



Microsoft ActiveX Data Objects 2.1 Library-

Location: C: \Program Files\Common Files\System\ado\msado21. tlb Language: Standard

Project/Library list Search box

Figure 2-9:

The Object Browser.

Project/Library list Search box

Figure 2-9:

The Object Browser.

Classes list Members list

Split bars Details pane

Classes list Members list

Split bars Details pane i Project/Library list: From here, you choose either a single object library to browse or <All Libraries> (where All Libraries really means all object libraries that are selected in the Reference dialog box).

i Search box: Here you type or choose a name to search for.

i Classes list: This shows the names of all classes in the currently selected object library or all available libraries if <All Libraries> is selected in the Project/Library list. A class is any class or group of objects, such as AllForms (all the forms in the current database).

i Members list: When you click a name in the Classes list, this pane shows the members (objects, properties, methods, events, functions, and objects) that belong to that class.

i Details pane: When you click a member name in the Members list, the Details pane shows the syntax (rules) for using the item that's selected in the Members list, as well as the name of the library to which the member belongs.

i Split bar: Drag the split bar left or right to adjust the size of the panes. (Drag any edge or corner of the Object Browser window to size the window as a whole.)

Clicking the Project/Library drop-down list displays the names of all currently loaded object libraries (all the object libraries to which you've set a reference in the References dialog box; refer to Figure 2-8), as follows:

Ii Access: Refers to the Microsoft Access 11.0 Object Library. This lets you control the Access program (menus bars and such) programmatically.

^ ADODB: Refers to the Microsoft ActiveX Data Objects 2.1 Library. This object library allows you to access all data in your database as well as data from outside databases.

^ DAO: Refers to the Microsoft DAO 3.6 Object Library. This is an older version of ADODB, mainly used for compatibility with older versions of Access.

^ stdole: Refers to the OLE Automation object library (where stdole is short for standard OLE). Provides programmable access to objects that use object-linking and embedding technologies, such as pictures in tables.

^ VBA: Refers to the Visual Basic for Applications object library. This library contains programmable access to objects built into the VBA programming language, such as functions for doing math with dates, times, and dollar amounts.

In addition to the names of object libraries selected in the References dialog box, the Project/Library list offers the name of the database you're working in. Consider the name of the current database to be the Project in the Project/ Library drop-down menu. You don't need to set a reference to that object library because it's built into the database that's currently open in Access.

Was this article helpful?

0 0

Post a comment