Variable Scope with Forms and Modules

J

JJ

If I call a user form from within a module, can I assign the values
from that form to variables declared at the module level or can I only
assign the values to global variables?
 
J

Jan De Messemaeker

Hi,

You can assign the values within the module.
Suppose your form is called MF, the control of which you search the value
MC, then this works
MF.Show
(When control returns to the module through a MF.hide in the form's code)

Whatevervariable=MF.MC.Value

.....
(When you have collected all the values you're interested in)
Unload MF

HTH
 
Top