|
-
Oct 25th, 2003, 07:18 AM
#1
Thread Starter
Hyperactive Member
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
-
Oct 25th, 2003, 08:42 AM
#2
Addicted Member
create a module and declare your global variables there
-
Oct 25th, 2003, 01:07 PM
#3
Lively Member
-
Oct 25th, 2003, 01:50 PM
#4
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.
-
Oct 25th, 2003, 10:00 PM
#5
Thread Starter
Hyperactive Member
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.
-
Oct 26th, 2003, 01:52 AM
#6
Lively Member
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...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|