|
-
May 8th, 2004, 11:50 PM
#1
Thread Starter
Junior Member
Linking text boxes on different forms.... why wont my code work?
I cant figure out how to link two text boxes on different forms together.
What I want to do is this:
From Form one, click a menu button and have it open form2. On form 2, you select something and it sends a text value back to form 1.
I cant figure it out.
Somebody save me
-
May 9th, 2004, 01:14 AM
#2
New Member
Hi,
it will work if you use global variable.
I assume you did the following on form2:
dim f as new form1
f.textbox1.text=me.textbox1.text
I also assume you want text box on form 1 to display the value after form 2 is closed
So try this:
in any module declare a variable, for example
Global gMyText as string
On form2 do this:
gMyText=me.textbox1.text
on form1 on activate event do this
me.textbox1.text=gMyText
-
May 9th, 2004, 01:15 PM
#3
Sleep mode
-
May 9th, 2004, 07:33 PM
#4
PowerPoster
Hi,
There are several recent threads on this. There are several ways to do what you want. Check the threads for the different advantages and disadvantages.
The simplest way is to instantiate all the forms as public in a module.
Taxes
The more I learn about VB.NET the more I like dBaseIII Plus
The foregoing, whilst believed to be correct, is given without guarantee as to it's accuracy and entirely without recourse. You are required to decide for yourself whether or not it is suitable for your purposes and no liability for loss of any nature can be entertained.
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
|