retaining global values

arage

Registered User.
Local time
Today, 13:09
Joined
Dec 30, 2000
Messages
537
What good is a globally defined field if it doesn’t retain data? Meaning, I have form control I set equal to a global variable and then when the sub or func ends the global variable becomes blank. I mean, I want to retain and hold that data in the global field. I defined it thus in its own module which I guess you would call a standard module.

Public GlobalRegionCode As Variant
Public GlobalRegDir As Variant

Option Compare Database
Option Explicit
 
If you defined the variable within the Form module then the variable will only be global within the Form.

If you define the variable in a Global module. Then it will retain it's value until you quit the current database.
(i.e. Create a new module from the Module page and define your global variable there)

Hope this is clear enough...
tc3of4
 

Users who are viewing this thread

Back
Top Bottom