xtremcoder
09-14-2003, 10:21 PM
I was working on my lab assignment and I wanted to take it “one step further” and make it a little more complex. I need to access a variable that I declared on another form. I tried to do:
otherForm.variableName
But I got a compiler error saying that object did not exist. I know you can do:
otherForm.Object.Property
Because I did this (from a second form) as a test:
Label1 = Form1.Text1.Text
So basically my question is, how do I access variable from another form. I remember something about have to declare the variables somewhere else, but I don’t remember the specifics of how you do it.
otherForm.variableName
But I got a compiler error saying that object did not exist. I know you can do:
otherForm.Object.Property
Because I did this (from a second form) as a test:
Label1 = Form1.Text1.Text
So basically my question is, how do I access variable from another form. I remember something about have to declare the variables somewhere else, but I don’t remember the specifics of how you do it.