SgiGod
February 13th, 2000, 01:48 PM
I have two forms Form1 and Form2 I need to know how to get info in text1 on form1 to go to text1 on form2 when command1 on form1 is clicked
Thanks in Advance
Donny S.
Thanks in Advance
Donny S.
|
Click to See Complete Forum and Search --> : Not Shure SgiGod February 13th, 2000, 01:48 PM I have two forms Form1 and Form2 I need to know how to get info in text1 on form1 to go to text1 on form2 when command1 on form1 is clicked Thanks in Advance Donny S. Starcraft February 13th, 2000, 03:01 PM command1_click() text1 = form2.text1 end sub AndyK February 13th, 2000, 04:21 PM Form2.Text1.Text = Form1.Text1.Text SgiGod February 13th, 2000, 06:45 PM I can't get the code you gave me to work i must be doing something wrong is there more you can tell me or show me. :) Thanks in Advance Donny S. AndyK February 13th, 2000, 09:05 PM Make 2 forms, on form1 add a texbox, and on form2 add a textbox. On form1 add a command button, double click the command button which will take you to the code window where you will see private Sub Command1_Click() End Sub add following line Form2.Text1.Text = Form1.Text1.Text so it will look like this private Sub Command1_Click() Form2.Text1.Text = Form1.Text1.Text End Sub now double click on Form1 and add this line inside this code private Sub Form_Load() End Sub add this lines between those above so it will look like this private Sub Form_Load() Text1.Text = "Hello" Form2.Show End Sub run the project and press command1, look onto form2's textbox, it should get the string "Hello" after command1 had been pressed Good Luck with your programming, you can read free book at www.informit.com, if you want to get started with VB :) codeguru.com
Copyright Internet.com Inc., All Rights Reserved. |