Viewing Objects Using the Object Browser


Now that you understand what objects and their respective properties, methods, and events are, let’s look at another way to view objects. The Object Browser is a tool that allows you to view and manage the objects in your application. You can use the Object Browser to learn about the objects available in Access 2007 as well as objects available from almost any Windows program.

The Object Browser can be opened from the Visual Basic Editor in one of three ways: by choosing the Object Browser button on toolbar, by selecting View image from book Object Browser, or by pressing F2. Any of these will result in a screen such as the one shown in Figure 3-15.

image from book
Figure 3-15

Notice how the Libraries drop-down list currently displays All Libraries. The values displayed in the Classes list are for the Classes of All Libraries. You can select a particular Library, such as Access, to limit the list of Classes and corresponding Class Members that are displayed (see Figure 3-16).

image from book
Figure 3-16

Notice how you can drill down into the Classes and view the properties, methods, and events available for the selected class. In the previous example, the Access Form class is selected, and you can see MouseUp and MouseWheel events (as indicated by the lightening bolt icon), various properties such as MouseWheel, and various methods such as Move. Notice how in this example the MouseUp event is selected, and you can see the syntax for the event in the bottom portion of the display. You can see why the Object Browser is a very useful tool for viewing and working with objects.

If you change the Libraries list to the current project (such as Ch3CodeExamples), you see the frmTestObjects form (see Figure 3-17).

image from book
Figure 3-17

Double-click on the Form_frmTestObjects class name to display a Code window showing the sub procedures and functions for that class module. In this example, you see the event procedures you created earlier in this chapter for the frmTestObjects form.




Beginning Access 2007 VBA
Beginning Access 2007 VBA
ISBN: 0470046848
EAN: 2147483647
Year: 2004
Pages: 143

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net