Passing parameters

J

John

I'm having trouble getting multiple forms to recognize the
same variable. I'm setting a variable = to an integer in
one form and I want the next form that loads to use that
number. I was under the impression that if I declared the
variable as public in the module, it would become global.
I tried this and it doesn't work (I tried dim and
public). Any help would be appreciated.
thanx,
john g
 
M

misha

you could move the global variable to a separate module so
that you don't have to worry about scope and lifetime of
the global variable.
 
M

Milan

You have three types of variables (constants) in terms of
their scope (visibility).
Local - functions/subs using word Dim in a function/sub,
Local within module using word Dim outside a function/sub,
Global - using word Global outside of function/sub

It seems that the third type which is visible everywhere
would fit your requirement.
 

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