I can't vouch for others, but here are the rules that I follow regarding the
placement of code:
Events of forms or events of controls on a form go into that forms module.
Any code that references a control on a form also goes into that forms
module. And any functions/subs that are called only within that forms
module, can also go in the module. In other words, other than event
handlers, all of the subs/functions in a form module are declared as private.
Non-form modules generally contain code that will be called by form modules,
so for the most part will be declared public. Occasionally, I will have a
sub/function that is only intended to be called by another sub/function
within that module declared private (sometimes facilitates a logical
breakdown of work).
For the most part, forms can call subs/functions from modules, but a
sub/function in a module should never call a sub/function in a form.
Likewise, a function/sub in a module should never directly reference a
control on a form, although it can receive a control passed as a parameter.
And a short rant on variables. Public variables are flat out evil, and
should only be used after first smashing your fingers with a hammer.
Seriously...a variable should have the minimum scope possible while still
performing it's duty. Never use a form level variable when a sub/function
level variable will due. And never use a public variable when a private
variable will due.
<stepping down from soapbox>
Ray