Passing parameters

  • Thread starter Thread starter John
  • Start date Start date
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
 
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.
 
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.
 
Back
Top