I'm using a variable declared in declarations on a frmMain. I'm trying to use that same variable in a module, but the code can't see it. What's the correct syntax for this?
Printable View
I'm using a variable declared in declarations on a frmMain. I'm trying to use that same variable in a module, but the code can't see it. What's the correct syntax for this?
Ok,
Let's just say you have another form called frmB which wants to use a variable in frmMain. So here is the variable declaration section in frmMain:
option Explicit
public strVar as string
So, if you want to use "strVar" in frmB, you have to declare this variable in frmMain as "Public".
Now, let's use it for something in frmB:
frmMain.strVar = "Hello World!!"
Hope this helps... =)
____________________________________
The VB Bugs in my Life...
Helped 100%. Thank you.