[AccessD] Classes and Events - Stay with us

jwcolby jwcolby at colbyconsulting.com
Tue Feb 10 11:17:36 CST 2009


 > Don't ever think that a lecture on Classes and Events (and Collections) is 'yea yea JC's goin on 
about classes again'!!!

Thanks for the support Drew!

Drew makes a good point that VBA classes are NOT the same as VB classes or VB.Net classes.  I have 
intentionally left out inheritance since we don't get that in VBA so why muddy the waters.  What we 
have is very powerful however so do not even think that you might as well not learn them.  VB 
classes are all that we have in VBA classes plus more, whatever you learn here will stand you in 
good stead if you move on.  More importantly it will make many things soooo much simpler to do in 
our Access applications.

I just posted a timer class lecture.  It is absolutely possible to do the same basic thing using a 
function and a static collection (to store the start times).  But the programming is messy, the "how 
does this thing work" is harder to understand, and the time to access a collection could impact 
accuracy, especially if you have a bunch of timers.

What you will find, and what you will hear from many people is that whatever you can do with classes 
can be done without them.  That is pretty much true but you may rest assured that often a class will 
yield an elegant and simple solution relative to the same thing done without classes.

John W. Colby
www.ColbyConsulting.com


Drew Wutka wrote:
> Don't ever think that a lecture on Classes and Events (and Collections)
> is 'yea yea JC's goin on about classes again'!!!
> 
> There are code samples all over the net.  Even a little bit of
> 'tutorial' information on how it works.  But there is a pitiful lack of
> explaining the actual concepts behind classes.  To C programmers, this
> is almost intuitive, because one of the true bonuses of C is that it
> allows inheritance.  And VB.Net is class based.  But VBA is still in the
> VB 6 subset, which even though it has classes, and can use Implements (a
> bastardized version of inheritance), it is far too easy to fall into a
> function dependent mode.
> 
> So Go JC Go! ;)
> 
> Drew
> 
> -----Original Message-----
> From: accessd-bounces at databaseadvisors.com
> [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby
> Sent: Tuesday, February 10, 2009 6:53 AM
> To: Access Developers discussion and problem solving
> Subject: Re: [AccessD] Classes and Events - Stay with us
> 
> Thanks for the encouragement to me and to "the class".  It is very
> important to those who haven't 
> been exposed to classes and events to hear from those who use them how
> useful this stuff is. 
> Without that input from other developers it can just be "yea, yea, JC's
> goin on about classes again".
> 
> I encourage any list members who use Classes and Events in Classes to
> speak up and tell your own 
> experiences using this stuff.  You might also discuss how it helped when
> it came time to learn .Net.
> 
> Thanks,
> 
> John W. Colby
> www.ColbyConsulting.com
> 
> 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