PC Review


Reply
Thread Tools Rate Thread

Class Module vs. Module - Philosophical Differences

 
 
=?Utf-8?B?dnNlYWxl?=
Guest
Posts: n/a
 
      9th Aug 2005
Just out of curiosity, is there an advantage of class module over a regular
module? Is there an additional flexibility/speed of one over the other?
Just what does a Class Module really offer me over a regular Module? Thanks.
 
Reply With Quote
 
 
 
 
Marshall Barton
Guest
Posts: n/a
 
      10th Aug 2005
vseale wrote:

>Just out of curiosity, is there an advantage of class module over a regular
>module? Is there an additional flexibility/speed of one over the other?
>Just what does a Class Module really offer me over a regular Module? Thanks.



A class module is a wholly different critter from a standard
module. The whole concept of a class is a rather deep
subject that really requires a text book to cover it
adequately. Access does not provide all the capabilities of
the classic definition of a class, but it does provide an
lot of nice features.

You can have multiple instances of a class. I.e. In a
class, module level variables are tied to its instance so
they are independent of other instances. In a standard
module, a module level variable exists once for your entire
application.

Class modules can also have properties (a Public variable),
methods (a Public Function or Sub) and events. While it is
possible to code a standard module to simulate properties
and methods, it is tedious and standard modules can not trap
events.

Don't forget that all form and report modules are class
modules.

--
Marsh
MVP [MS Access]
 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
running a Sub in a class module from a functionin a general module Paul Microsoft Access Form Coding 2 9th Feb 2010 02:25 AM
Difference between Form's Class Module and Class Module tobesurveyor via AccessMonster.com Microsoft Access VBA Modules 4 14th Apr 2006 01:08 PM
Convert Class Module to Standard Module =?Utf-8?B?TXVycA==?= Microsoft Access VBA Modules 2 26th Apr 2005 06:33 AM
VB hang when opening a class module (or form module) Antoine Microsoft Access 1 7th Mar 2004 12:20 AM
Variable from a sheet module in a class module in XL XP hglamy Microsoft Excel Programming 2 14th Oct 2003 05:48 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:19 AM.