Databases Reference
In-Depth Information
component (that is, standard or class modules), you can just double-click on the item in
the Projects window.
8.3.1 Procedure and Full-Module Views
Generally, a code module contains more than one procedure. The IDE offers the choice
between viewing one procedure at a time (called procedure view ) or all procedures at
one time (called full-module view ), with a horizontal line separating the procedures. Each
view has its advantages and disadvantages, and you will probably want to use both views
at different times. Unfortunately, Microsoft has not supplied a menu choice for selecting
the view. (I've complained about this in my other books as well, but Microsoft does not
seem to be listening to me. Strange.) To change views, click on the small buttons in the
lower-left corner of the Code window. (The default view can be set using the Editor tab
of the Options dialog box.)
Incidentally, the default font for the module window is Courier, which has a rather thin
looking appearance and may be somewhat difficult to read. You may want to change the
font to FixedSys (on the Editor Format tab of the Options dialog box, under the Tools
menu), which is much more readable.
8.3.2 The Object and Procedure Listboxes
At the top of the Code window there are two drop-down listboxes (see Figure 8-1). The
Object box contains a list of the objects that are associated with the current project, and
the Procedure box contains a list of all of the procedures associated with the object
selected in the Object box. The precise contents of these boxes vary depending on the
type of object selected in the Project Explorer.
When a standard module is selected in the Project window, the Object box contains only
the entry ( General ), because there are no objects in a standard module with which to
associate code (or any objects at all). In this case, the Procedure listbox contains a list of
the current procedures in that module.
When a form is selected, the Objects listbox contains a list of each control on the form, as
well as entries for page and form headers and footers, the detail section of the form, and
so on. As Figure 8-4 shows, when we select an object, such as a command button, in the
Objects listbox, the Procedures listbox contains a list of procedures for that object. When
you selecting a procedure, Access will automatically place the cursor in the appropriate
location in the code window, so we can start entering code.
For example, if we choose the Click event in the Procedures box, Access will create the
following code shell for this event, and place the cursor within this procedure:
Private Sub cmdPushMe_Click( )
End Sub
Search WWH ::




Custom Search