Code Builder and Macro Builder

The Code Builder displays the Module window, in which you create or modify an event procedure from within an event property of a form, report, section, or control. Code behind forms is new to Microsoft Access 2.0. This allows you to store attached code with your form or report. Note that this code can't be seen from the module in the database container.

To use the Code Builder:

  1. Open a form or report in Design view.
  2. Display the properties of the form, report, section, or control.
  3. Select the event property for which you want to create an event procedure or select an event that you wish to modify.
  4. Click the Build button next to the event property and, if creating a new event procedure, choose Code Builder from the list. You may also use the right mouse button. Microsoft Access displays the Module window.
  5. Edit the procedure and save it.
  6. When you close the Module window, [Event Procedure] appears on the property sheet next to the event property you selected. This indicates that you have code attached to your event.

    The Macro Builder can be invoked from an event property as well. Follow the first three steps. Then, instead of choosing the Code Builder, choose the Macro Builder. A new macro window will be opened and the name of the macro will be filled in the event property.