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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top