first_page the funky knowledge base
personal notes from way, _way_ back and maybe today

Actually Treating a Form (with HasModule = True) as a Class

It was difficult for me to unify my understanding of my user-defined classes with the idea of a Form as a class. I used to draw a blank when I saw that Access calls a form code module a "Class Module." But now I have an understanding:

The code behind forms is not only continually compliled (assuming Compile on Demand is enabled under Tools > Options... > Coding Options) but it is also continually instantiated. User defined classes are not so lucky as they must be Set with the keyword New before they create objects.

An unbound text box control in a form with a Class Module should be thought of as a class Property of type Variant. This implies that this Form is the graphical interface of an instantiated class. So an unbound text box in a form without a class module (HasModule = False) is truly unbound. But a form that has a module implicitly "binds" its text boxes to referable memory locations for the duration of its instance.

mod date: 1998-11-30T16:47:07.000Z