Datasheet
Book VIII
Chapter 1
What the Heck
Is VBA?
Finding VBA Code
573
You can also get to a class module from the Event tab of the Property sheet
in the Design View window. The Property sheet allows you to zoom right in
on the VBA code that’s associated with a given control. For example, some
controls contain code created by wizards. When you click such a control and
then click the Events tab in the Property sheet, the property value chose
[Event Procedure]. When you click [Event Procedure], you see a
button with three dots, like the one near the mouse pointer in Figure 1-3.
That’s the Build button. Click it to see the code that executes in response to
the event.
To write custom code for a control, select the control in Design view, open
the Property sheet, click the Event tab, click the event to which you want to
attach some custom code, click the Build button, and then choose Code
Builder.
After you open a module, you’re taken to an entirely separate program
window called the
Visual Basic Editor, where you see the module in all its
glory.
Creating or opening a standard module
Standard modules contain VBA code that isn’t associated with a specific
form or report. The code in a standard module is available to all tables,
queries, forms, reports, macros, and other modules in your database. You
won’t see Module as an option when you’re viewing All Access Objects in the
shutter bar until you create at least one standard module. You have to go
looking for options to create and work with modules.
Figure 1-3:
Look for the
code that
executes in
response to
the event.
38_036494 bk08ch01.qxp 11/17/06 8:34 AM Page 573