>>But that could be a rather long processus when you have many variables. I would rather declare it public than have no problem. The thing is that I would have thought that if I declare a LOCAL variable in the init event of a form or formset, all objects or events on that form would have access to it but it doesn't look like it is working like that.
>>
>>Thanks,
>>Yves
>Your right it doesn't work like that. Also, I would highly discourage declaring PUBLIC variables to hold values for an individual form. As you are probably well aware of it is a dangerous practice in any progamming language.
>
>Even if you have to had 10-20 form properties it is still preferable to using PUBLIC variables. In the Codebook framework for example they use dozens of properties to that maintains "variables" on how a particular object will operate. Plus using properites makes it easier to set up default variables and to let you see the critical values of a form/object by browsing the properties list. Otherwise you have to dig though methods to find what public variables are being used.
>
>If you give us more info about the specifics of your form we may be able to come up with ideas to better handle variables/properties. But, again I wouldn't go the PUBLIC variable direction for form stuff.
>
>BTW, I do use public variables for a few reasons.
>
>1. maintaining a global application object. GoApp
>2. maintaining a user/security object. GoUser
>3. a bailout flag for my error handler. glMustQuit
>
>
>Greg Moss
>gmoss@midwest.net
Thanks Greg,
Now I can say that I see the point of declaring variable through a property of a form. I have a few question for you if you don't mind too much (or to anybody else), is a controlsource considered a variable in a form? Or is it just a name you give to access the object value? By declaring a variable through a form property, is it possible to access this variable from a another form called by that form (where the variable is located)?
Thanks,
Yves
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only