0

I have three separate forms.
Form1, Form2, and Form3

I declared Public var1 as Integer within Form1.
Form2 and Form3 can see/access var1 as Form1.var1

However,
when I declare Public var2 as Integer within Form2 (when it opens), Form3 (when opened) cannot access var2 whatsoever.

Don't know what I'm missing. Perhaps a fundamental rule for declaring/using Public variables???

Help is appreciated.

Thanks.

3
Contributors
2
Replies
3
Views
8 Years
Discussion Span
Last Post by c0deFr3aK
0

In visual basic 6.0, of which you have posted your question in the wrong forum, public form variables are access via form1.variablename

Good Luck

0

I have three separate forms.
Form1, Form2, and Form3

I declared Public var1 as Integer within Form1.
Form2 and Form3 can see/access var1 as Form1.var1

However,
when I declare Public var2 as Integer within Form2 (when it opens), Form3 (when opened) cannot access var2 whatsoever.

Don't know what I'm missing. Perhaps a fundamental rule for declaring/using Public variables???

Help is appreciated.

Thanks.

Just create a Module and declare all your Public variables there.
you can access all those variables anywhere in your program

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.