On Wed, 19 Mar 2003 15:36:39 -0800, "Peter Hamilton"
Quote:
>I have several Subs defined in my dbase. I can't run
>these using macros or the 'on click' function of a form
>button. What's with that? I believe I have to change
>these Subs to Functions. What will this affect?
>Perfomance? Anything?
Subs and Functions differ only in that:
- a Function returns a value, and a Sub doesn't (you can ignore the
returned value if you want
- Only a Function can be executed in a Event property, by putting
=FunctionName(parameters)
in the event. Note that Access provides automatic Subs - if you select
a click event and choose Code Builder, Access will put
[Event Procedure]
in the property and generate a Sub/End Sub pair of lines in the form's
module. Within that Sub you can call another sub, or execute a
function.
There is no performance difference to my knowledge.
John W. Vinson[MVP]
Come for live chats every Tuesday and Thursday
http://go.compuserve.com/msdevapps?loc=us&access=public