Greg, this is Microsoft advice
Convert macros to VBA code

You can use Access to automatically convert macros to VBA modules or class modules. You can convert macros that are attached to a form or report, whether they exist as separate objects or as embedded macros. You can also convert global macros that are not attached to a specific form or report.
Convert macros that are attached to a form or report

This process converts to VBA any macros that are referred to by (or embedded in) a form or report (or any of its controls) and adds the VBA code to the form or report's class module. The class module becomes part of the form or report and moves with the form or report if it is moved or copied.

  1. In the Navigation Pane, right-click the form or report, and then click Design view.
  2. On the Form Design tab, in the Tools group, click either Convert Form's Macros To Visual Basic or Convert Report's Macros To Visual Basic.
  3. In the Convert form macros or Convert report macros dialog box, select whether you want Access to add error handling code to the functions it generates. Also, if you have any comments in your macros, select whether you want to have them included as comments in the functions. Click Convert to continue.
    If no class module exists for the form or report, Access creates one and adds a procedure to the module for each macro that was associated with the form or report. Access also changes the event properties of the form or report so that they run the new VBA procedures instead of the macros.
  4. To view and edit the VBA code:

    1. While the form or report is still open in Design view, if the property sheet is not already displayed, press F4 to display it.

    2. On the Event tab of the property sheet, click in any property box that displays [Event Procedure], and then click the build button
      . To view the event properties for a specific control, click the control to select it. To view the event properties for the entire form or report, select Form or Report from the drop-down list at the top of the property sheet.Access opens the Visual Basic Editor and displays the event procedure in its class module. You can scroll up or down to view any other procedures that are in the same class module.