Functions, sub's and private sub's...

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

In using VBA in MS-Access, can someone give me a 50 word or less explaination
of the differences between sub routines, private sub routines and fuction
modules?
Thank you in advance.
JEB
 
JEB said:
In using VBA in MS-Access, can someone give me a 50 word or less
explaination of the differences between sub routines, private sub
routines and fuction modules?
Thank you in advance.
JEB

A sub-routine runs some code and does not return a value to what ever called it.

A function runs some code and does return a value to its caller though its
caller might decide not to do anything with that returned value. Functions can
be called from macros and form/report/query expressions while sub-routines
cannot.

A private sub (or function) is one that can only be called from within its own
class module. For example the Current event of a form can only be called by
that form or another piece of code in that same form module unless the Private
is change to Public.
 
Back
Top