Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to pass data between 2 forms

Status
Not open for further replies.

huichun

Programmer
Jul 24, 2002
8
US
I have two forms.
form1 and form2
in form1 I have a textbox let user type in data then I grab that data put into form2.
How do I do it, any thought?

Thanks,
Huichun
 
To put the data from the textbox in Form1 into Form2, like this maybe:

dim frm as new Form2

frm.txtText = Form1.txtText
 
Im not sure that will work since you need to reference a particular instance of the form
 
Dim c As New Form2()
c.TextBox1.Text = TextBox1.Text




This transfers the text in TextBox1 in Form1 to Text in TextBox1 in Form2
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top