> > Out of curiosity, can you give me an example of the types of things
class
> > modules are typically used for? What kinds of problems can they solve?
> > Perhaps I'll find somewhere to use one.
>
> In the context of the point I was making, I am taking about business
> objects, such as Organisation, locations, employees, etc., or something
> along the lines of the purpose of the company, such as products,
customers,
> etc. You may notice that most (all) of these suggest a plural, and the
> concept of a collection class is one of the most useful IMO.
>
> As an example, I created an appointment for my wife a while back, that had
a
> class for the consultants, a class for the patients, and another
> appointments class (probably a few more in there besides, but I don't
> remember). One of the advantages of the class, over and above the stated
> advantages such as encapsulation, was that I could create a simple test
> harness for each class and prove it independently. Assuming my design
> worked, plugging it all together at the end was a doddle.
I can think of a recent situation where I have a collection of values used
for applying calculations, formatting, etc. I was thinking of putting all
that stuff in a separate worksheet and having code reference the sheet and
cell to make various user-requested changes in the other worksheets. I
suppose I could make that into a class and let the user select options from
a menu bar rather than monkey with that separate worksheet. But can I
insert a class module into a workbook via automation from Access?
|