I thought this was correct, but to clarify I sent an email to the author of some of the microsoft press books. This is the reply he sent me:
James-
Access (95 and later) has two types of modules - Public modules and Class
modules.
You define all Public modules on the modules tab in the database window. If
you click on the new button while on the modules tab, Access creates a
Public module by default. Any Public function you declare in a public
module can be called from anywhere in Access, including from event
properties and queries. Any Public sub you declare in a public module can
be called from anywhere in code.
All Form and Report modules are Class modules. You can also define a Class
module in the database window by choosing Class Module from the Insert menu.
Class modules are Objects, and they become active only when an instance of
the class is active. Access instantiates form and report class modules
whenever the form or report is open. When you declare a Function or Sub as
Public in a class module, they become Methods of the Class. You can execute
them (as long as the object is active) just like you would execute the
method of any other object:
' Example of built-in method:
Set rst = db.OpenRecordset("MyQuery"
' Example of a custom method:
Form_MyForm.DoSomething
In the second case, Access looks for a public Sub called "DoSomething" in
the form named "MyForm".
Note that you can also define custom Properties for form and report objects
by coding Property Let and Property Get and Property Set public functions
within the class module.
Even when a form is open as a subform in another form, you can still get to
its public functions and subs directly. Let's say you have a form called
"MySubForm" that has the following code in it:
Public Sub Hello()
MsgBox "Hello"
End Sub
When the parent form is open in form view, you can execute this method by
saying:
Form_MySubform.Hello
Hope that helps...
John Viescas, author
"Running Microsoft Access 2000"
"SQL Queries for Mere Mortals"
P.S. Feel free to post this back in the newsgroup where you originally asked
your question.
Hopefully this will clear things up for future people! James Goodman
j.goodman00@btinternet.com