RoadKyng said:
I am jsut starting to get into the use of modules and public functions. I
need to research on how to call a public function or module from a private
function.
I assume a public function or module is one that can be used by all private
functions by calling and assigning the variables used in the public
function/module. (confused yet?)
I tried it on a form and could see the code in the private function
assigning the variable I had set up in a public module with the correct
value. But when I tried to call this value later in another private function
it gave me a null value.
I still have alot to learn and very much appreciate the time you and the
other MVP's here give to us amatures.
I'm not sure if there was a question in there. About all I
can say at this point is that most procedures in standard
modules are public. Public Functions can be called from
just about anywhere in Access (including queries and text
box expressions). Public Subs can be only be called from
VBA procedures.
By default, procedures (both Functions and Subs) in Class
modules (including form and report modules) are private.
Private functions can only be called from within the same
module. Note that Public procedures in a class module are
methods (something that you are unlikly to use without a lot
more experience) of the class.
For both functions and subs, you should normally provide
values to the procedure by using arguments, not by setting
global variables.
If you have a specific question, post back with more details
about what you are trying to do.