|
-
January 6th, 2000, 09:27 PM
#1
Variable in form used in module?
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?
-
January 6th, 2000, 09:39 PM
#2
Re: Variable in form used in module?
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...
-
January 6th, 2000, 09:56 PM
#3
Re: Variable in form used in module?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|