Gustav Brock
Gustav at cactus.dk
Wed Feb 25 10:37:12 CST 2009
Hi Charlotte OK, I see what you mean. I was talking about the value of that property. Sorry for not being precise. /gustav >>> cfoust at infostatsystems.com 25-02-2009 17:08 >>> 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