Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ClassModule and Module

Status
Not open for further replies.

thegameoflife

Programmer
Dec 5, 2001
206
US
How are they different? When do you use one or the other?
 
For some more detail, read this thread and look for my (CVigil's) post of Nov. 12, 2002:
thread705-399377
I just copied the next paragraph from that post. Also, since the original poster in that thread replied to me with, "Thank you C Vigil! I found that very information in help after searching for it [...]", I'd suggest reading the help for more detailed info as well [smarty] .

This paragraph is simply education:
--------------------------------------
Class modules and (normal) modules are essentially the same, and essentially different. You use the same kinds of code in class modules as you do in (normal) modules (plus some), but class modules give you *objects* you can use and create instances of. The code attached to a form is in a class module; and the class name is the name of the form. That is what lets you have multiple instances of a single form, through VB. A class module's Subs and Functions become methods and properties of the class. A TextBox is a class. A Label is a class. In a sense, "class" is like "object", and so "class modules" could be called "object modules".

Hope this helps you on your way! -- C Vigil =)
(Before becoming a member, I also signed on several posts as
"JustPassingThru" and "QuickieBoy" -- as in "Giving Quick Answers")
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top