|
-
Sep 4th, 2003, 02:25 PM
#1
Thread Starter
Member
using modules
Okay, I feel stupid again I can't remember how to use a module, since it's been about 3 years since I learned about one. I don't use vb much, and am trying to relearn it.
take a simple module:
VB Code:
Module myModule
Dim sString1 as String
End Module
How do I use the module in form1, form2, whatever?
Or, if I am way off base, my ultimate goal is to have sString1 visible to pretty much the entire application (preferably without having to jump through too many hoops)
What does "formatting drive C..." mean?!
-
Sep 4th, 2003, 02:31 PM
#2
You'd use:
MessageBox.Show(myModule.sString1)
-
Sep 4th, 2003, 02:34 PM
#3
Thread Starter
Member
not quite....
I want to be able to access, change, store, everything, just as if I had declared it within the same block. I want to be able to use the same variable in different forms, though.
What does "formatting drive C..." mean?!
-
Sep 4th, 2003, 02:39 PM
#4
Originally posted by white_as_snow
not quite....
I want to be able to access, change, store, everything, just as if I had declared it within the same block. I want to be able to use the same variable in different forms, though.
You'd use:
MessageBox.Show(myModule.sString1)
or rather
myModule.sString1
If it doesn't work its because you dimmed the sString1 instead of declaring it Public. Just make that change and you are in business.
-
Sep 5th, 2003, 07:12 AM
#5
Thread Starter
Member
Yeah... I figured that out a little later... my stupid friend told me not to declare it public, and for some reason I listened. Thanks!
What does "formatting drive C..." mean?!
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
|