[AccessD] Classes and Events

Drew Wutka DWUTKA at Marlow.com
Mon Feb 9 15:34:18 CST 2009


I know what you mean about presenting things in a different light.  Once
I got into the groove with Classes and Collections I wondered why I
didn't start using them from the get go! ;)

Drew

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby
Sent: Monday, February 09, 2009 1:11 PM
To: Access Developers discussion and problem solving
Subject: Re: [AccessD] Classes and Events

 > To clarify (if you don't mind JC)

Not at all Drew.  This stuff is just different enough that having things
said in a slightly 
different way may be just what is needed for it to "click" (pun
intended).

To expound a bit further on Drew's example, if you have 20 command
buttons, and if each command 
button is going to need the same code, then you would instantiate the
command button class 20 times, 
and each instance would handle ONE COMMAND button.  The button's Click
event would be sunk right 
inside of the class, the code to run would be right inside of the class
etc.

John W. Colby
www.ColbyConsulting.com


Drew Wutka wrote:
> To clarify (if you don't mind JC), a class module can only raise it's
> OWN events.  IE, if you have 20 command buttons, clicking a command
> button will raise THAT command buttons 'OnClick' event.  Now, from
code,
> you can CALL 'MyCommandButton_OnClick' which will run the code you
have
> on your form (which is handling the OnClick event of that command
> button, but it's not actually raising the event.  If other class
modules
> have that command buttons events sunk into them, only clicking the
> button (having the command button raise it's own event) will trigger
> them all. 
> 
> Now, to be even more specific, class modules usually have a way to
> trigger their events programmatically.  For instance, the OnOpen event
> of a form, can be triggered by programmatically opening that form.  
> 
> Drew
> 
The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited.





More information about the AccessD mailing list