There's really no such thing as a Public Module.
There are three main module types in an Access project :
- Object Modules - Associated with form or report objects.
- Class Modules - Define a class that can be used elsewhere in your project.
- Standard Modules - Not associated with anything in particular. Procedures, variables and other items in this type of module can be accessed from other areas of the project as long as they are defined as Public.
Variables, Constants, Function Procedures and Subroutine Procedures can all be defined as either
Local,
Private or
Public.
Local items are accessible only from the procedure within which they are defined. A standard
Dim within a procedure defines
Local items.
Private items are only accessible from the same module. This is true of all of the types of module.
Public items, on the other hand, are accessible across the whole project.
For something to be easily accessible to the whole project it should be defined as
Public in a Standard Module. This is because any class or object reference would treat the item as a property of an instance of the related class or object and therefore couldn't be referenced as easily as simply specifying the name. It may be easier to conceptualise if you were to consider Standard Modules as being associated with the overall project itself, whereas the other types are associated with their own specific object, thus cannot be accessed independently.
I hope that clarifies the situation for you.