4.2 What is a VBA “Module”?

A VBA module is a unit to contain code that does not relate to forms and other application dependent objects in Access. Each module may contain any number of variable, function or subroutine definitions. Unless otherwise specified as Private definitions in a module can be accessed throughout the application.

How many modules should you define? That depends on the amount of code that you are writing in the modules, and how the subroutines, functions and variables relate to each other.

For simple coding, you can use a “generic” module for everything. However, as soon as you code gets complicated and require a function or subroutine to call one another, you should consider organizing related functions and subroutines into separate modules.