class module programming?

K

KR

I'm about to revamp a program I wrote to take advantage of making up a class
(or several) to better organize the data and controls in my userform. I
understand the basic idea of classes (person class has name, phone, address,
birthday, etc.) but I need to learn more about two things, so if anyone can
point me to resources that have good explanations and snippets I can play
with, I'd appreciate it;

(1) "Meta classes", e.g., groups of classes. For example, instead of having
a bunch of different instances of my person class and having to sort through
all of them to see which ones work in Finance, I'd like to make some sort of
'finance group' and assign all the instances of the finance people to that
meta-class. Hopefully to loop through that meta-class when I need to pull
data from all of those instances.

(2) How to best call my meta-classes from a treeview? I'm going to replace a
series of interdependent optionbutton groups with a treeview on my
userform(office97); is there a preferred method of linking a treeview
selection (including which event(s) and possible problems) to drive which
metaclass I pull data from for the rest of my userform?

Many, many thanks,
Keith
 
N

NickHK

Keith,
For #1, you can create a class that holds a collection of "Persons", one for
each "Department".
You can also have a class that holds a collection of collections,
"Organisation", so all your departments are contained.

As for #2
From the "Organisation", you then add a node for each "Department"
collection, then do the same within each Department, adding nodes for each
"Person".

Depending how many nodes you expect and how they will be filled (over a
network ?), you do not have to fill the whole treeview initially, as most
are not immediately visible.
You can fill nodes as required, from a suitable event.

NickHK
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top