By extending your database to include Visual Basic procedures, you can customize the way the tables, forms, reports, and queries in your database work together. There are several types of procedures. You can create an event procedure by adding code to predefined templates in a form module or report module. You also can create your own Function procedures or Sub procedures in standard modules, or in class modules (which include form and report modules).
You can call procedures in a standard module or a class module from expressions, from other procedures, event procedures, procedures in other modules, and macros. Event procedures run automatically in response to events — such as mouse clicks — that occur on a form, report, or control.