ACC2: Comparison of Form or Report Modules and Global Modules

ID: Q114217


The information in this article applies to:


SUMMARY

Moderate: Requires basic macro, coding, and interoperability skills.

In Microsoft Access version 1.x, you can extend the behavior of forms, reports, and controls by writing a function or macro, and then calling that code when an event occurs.

In Microsoft Access version 2.0, you can still call macros or functions directly from events. In addition, you can write event procedures that are stored in special modules, called form or report modules, for each form or report. This functionality is similar to how Microsoft Visual Basic stores procedures for forms.


MORE INFORMATION

Comparison of Global Modules and Form and Report Modules

There are several differences between code in a global module and code in a form or report module, including the following:

How to View Code in a Form or Report Module

Method 1:
  1. Open the form or report in Design view.


  2. From the View menu, choose Code. Or, choose the Code button on the toolbar.


Method 2:
  1. Open the form or report in Design view. This loads the form or report's module into memory.


  2. From the Window menu, choose Database.


  3. In the Database window, choose the Module button.


  4. Open any module.


  5. Press F2. The form or report module will be listed as Object.ObjectName (for example, Form.FormName).



REFERENCES

For more information about form and report events, search for "events: forms" or "events: reports," and then "Events and Event Properties Reference" using the Microsoft Access Help menu.

Additional query words: code behind forms cbf


Keywords          : kbusage FmsHowto 
Version           : 2.0
Platform          : WINDOWS 
Issue type        : kbinfo 

Last Reviewed: April 3, 1999