The one thing I did notice Vig, is that you have to be careful about managing the "lifetimes" of forms created within a UDF ... if you create (CreateObject) a form inside a UDF, the assumption is that the life-time of the Form will jive with the lifetime of the function (that is to say: very short) ...
If that's the case, then you "should" DIM all FORMS AND CONTROLS used in the UDF ... the objects get created, used, then destroyed automatically when you exit the function (no need for $form=0 type thingy) ...
If the form is meant to be re-used many times - maybe it should be declared (and built-up) as GLOBAL in the mainline ... then selectively made VISIBLE (SHOW) and HIDDEN as required.
The way it is right now (I think) is that becuase your not dimming .. the first time you enter the UDF - a form is created ... then it persists after the UDF finishes ... the next (second) time through, the CreateObject then globbers the previous one ... kinda thingy [ 03. September 2002, 19:20: Message edited by: Shawn ]
|