Highlights of the Menu System


While many commands are common to all Windows programs, the Edit, View, and Tools menus contain features unique to the VBA Editor that you need to know about to work effectively in the VBA environment.

Edit Menu

Most of the commands in the Edit menu are found in other Windows programs, such as Copy, Cut, and Paste. However, some commands unique to the VBA environment are

  • List Properties/Methods, which displays a dropdown list box in the Code window that shows the properties and methods available for an object.

  • List Constants, which displays a dropdown list box in the Code window that lists the constants whose value can be assigned to a property or to a function or sub argument.

  • Quick Info, which opens a popup in the Code window that provides the syntax for a function, sub, or statement.

  • Parameter Info, which displays a popup in the Code window that provides information about the parameters of a sub or function.

  • Complete Word, which completes a word that you are typing in the code window once you’ve typed enough characters for the editor to successfully identify it.

View Menu

The commands available on the View menu for the most part control which windows are open in the VBA environment and which toolbars are displayed. Among the options available on the View menu are the following:

  • The Code command displays any code associated with an object if that code is not already showing. ( The object it is showing the code for is the object selected in the Project window.)

  • The Object command switches you to the object in Access.

  • The Definition command opens the Object Browser, selects the object that is selected in the Code window, and displays its properties, methods, and events.

  • The Object Browser command also opens the Object Browser, which gives you a list of the objects found in libraries referenced by the project and their respective members (that is, their properties, methods, and events). Unlike the Definition command, the Object Browser command opens the Object Browser for general use, without specifically selecting the object currently selected in the Code window. We will be examining the Object Browser in greater detail later in this chapter.

Tools Menu

The Tools menu allows you to configure the current project as well as the VBA environment as a whole. Options available from the Tools menu include

  • The References command allows you to open a list of object libraries that are registered in the system registry, such as ADO, and create a reference to them. We will be coming back to this as we progress through this book.

  • The Macros command simply shows you a list of macros in the current database.

  • The Options command brings up a dialog box that allows you to change the VBA Editor’s environment.

Menu Shortcut

In addition to using the individual menus, you can right-click in the Code window and get a list of commonly used menu items, as shown in Figure 7-2. This is a static menu that offers one-click access to some common menu commands. It is not a dynamic menu whose contents reflect menu items that you’ve recently selected.

click to expand
Figure 7-2: The menu shortcut




Access VBA Programming
Microsoft Access VBA Programming for the Absolute Beginner
ISBN: 1598633937
EAN: 2147483647
Year: 2006
Pages: 214
Authors: Michael Vine

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