[AccessD] Function vs Sub (was: Classes and Events- EVENTSNOTREQUIRED)

Charlotte Foust cfoust at infostatsystems.com
Wed Feb 25 10:08:25 CST 2009


No it doesn't, it's setting a property of the event.  That isn't the
same thing as returning a value as does a function.  Subs are quite
capable of setting values or they wouldn't be as useful as they are.
They do NOT return a value directly however.

Charlotte Foust 

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Gustav Brock
Sent: Tuesday, February 24, 2009 11:56 PM
To: accessd at databaseadvisors.com
Subject: Re: [AccessD] Function vs Sub (was: Classes and Events-
EVENTSNOTREQUIRED)

Hi Charlotte

Eh, you can't have forgotten that setting Cancel to True in your code of
such a sub will return that value to the form?

/gustav


>>> cfoust at infostatsystems.com 24-02-2009 22:21 >>>
Not sure I follow, Stuart.  Subs set values like Cancel or process a
keycode.  They don't return them per se.

Charlotte Foust 

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Stuart
McLachlan
Sent: Tuesday, February 24, 2009 1:12 PM
To: Access Developers discussion and problem solving
Subject: Re: [AccessD] Function vs Sub (was: Classes and Events -
EVENTSNOTREQUIRED)

Which begs the question, why does VBA use Subs for event procedures
which return values such as Cancel or KeyCode?  Aren't these Functions?
:-)

--
Stuart
 

On 24 Feb 2009 at 9:24, Charlotte Foust wrote:

> Absolutely when you need multiple return values, but a simple boolean 
> or single value?
> 
> Charlotte Foust



-- 
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com




More information about the AccessD mailing list