Creating a Class Module for a Form or Report

Similar to the standard modules that you create, you can also create class modules with the Visual Basic Editor. You usually begin a class module in Design view for a form or report. In most cases, class modules are associated with events such as clicking a form button or opening the form. Unlike standard modules, class modules do not appear in the Modules Object list in the Database window. Instead, you can access them from within the Project Explorer.

Create a Class Module for a Form or Report

graphics/1_icon.jpg

Display a form or report in Design view.

graphics/2_icon.jpg

Click the control or object within the form or report in which you want to create a class module, and then click the Properties button on the toolbar.

graphics/3_icon.jpg

Click the Event tab.

graphics/4_icon.jpg

Click the event box that you want to associate with a VBA procedure.

graphics/5_icon.jpg

Click the Build button.

graphics/6_icon.jpg

Click Code Builder.

graphics/7_icon.jpg Click OK.

The Visual Basic Editor opens a Modules window and automatically creates an Event procedure for the control and event you selected.

graphics/8_icon.jpg

Enter the VBA commands you want.

graphics/14inf09.jpg



Show Me Microsoft Office Access 2003
Show Me Microsoft Office Access 2003
ISBN: 0789730049
EAN: 2147483647
Year: 2002
Pages: 318

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