Convert macros to Visual Basic

Microsoft Access can automatically convert macros (macro: An action or set of actions that you can use to automate tasks.) to Microsoft Visual Basic (Microsoft Visual Basic: A high-level, visual-programming version of Basic. Visual Basic was developed by Microsoft for building Windows-based applications.) event procedures (event procedure: A procedure that is automatically executed in response to an event initiated by the user or program code, or that is triggered by the system.) or modules (module: A collection of declarations, statements, and procedures stored together as one named unit. There are two types of modules: standard modules and class modules.) that perform equivalent actions by using Visual Basic code. You can convert macros on a form or report, or you can convert global macros that aren't attached to a specific form or report.

ShowConvert macros on a form or report

  1. Open the form or report in Design view (Design view: A view that shows the design of these database objects: tables, queries, forms, reports, and macros. In Design view, you can create new database objects and modify the design of existing objects.).
  2. On the Tools menu, point to Macro, and then click Convert Form's Macros To Visual Basic or Convert Report's Macros To Visual Basic.

ShowConvert global macros to Visual Basic

  1. In the Database window (Database window: In Access 2003 and earlier, the window that appears when a database or project is opened. It displays shortcuts for creating new database objects and opening existing objects. In later versions, it is replaced by the Navigation Pane.), click Macros Button image under Objects.
  2. Click the name of the macro you want to convert.
  3. On the File menu, click Save As.
  4. In the Save As dialog box, click Module in the lower text box and click OK.
  5. In the Convert Macro dialog box, select the options you want, and click Convert.
Applies to:
Access 2003