-
Using global variables
What is the best way of sharing common data (example - an order number) between multiple forms? I have tried a global class but values get re-initialized between forms...
I have tried property bags but can not get then to be "seen" fetween forms...
gollnick
-
create a module and declare your global variables there
-
-
An OOP approach would mean you'd have an order object that gets passed around. Maybe even a process class, something like FillOrder to maintain state during a new order.
-
I created a global module but I lose scope from from to form. In other words .. what I assign to a global variable in form1 coes to me as blanks when I grab it in form2. I DIM the class but when I do it as NEW ... alls gone.
-
That makes sense, because when you New anything, you reinitialize it. Don't do that. Just declare your variables in the module and set them as you go, and as long as one of the forms from your app stays open, the variables in the module should persist. Works that way for me anyhow...