Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > VB How-To
|
VB How-To Ask your "How do I do this with VB?" questions in this forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB How-To section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 22nd, 2004, 01:49 AM
Registered User
 
Join Date: Feb 2004
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default How To passing the data in textbox to other form?

If i type something in Form1 textbox,
then i want to show the text in form2 textbox/list box

how can i do??

Thankyou~~



 
Old February 23rd, 2004, 09:21 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,151
Thanks: 2
Thanked 14 Times in 14 Posts
Send a message via ICQ to SerranoG Send a message via AIM to SerranoG
Default

Quote:
quote:Originally posted by lammyhk
 If i type something in Form1 textbox, then i want to show the text in form2 textbox/list box

how can i do??
If Form2 is showing and Form1 is hidden then

   Me.TextBox2 = Forms.Form1.Form.TextBox1

If Form1 is showing but Form2 is hidden then

   Forms.Form2.form.TextBox2 = Me.TextBox1


Greg Serrano
Michigan Dept. of Environmental Quality, Air Quality Division
 
Old February 23rd, 2004, 10:57 AM
Friend of Wrox
 
Join Date: Aug 2003
Posts: 205
Thanks: 0
Thanked 0 Times in 0 Posts
Default

In the validate event of the textbox type in the code to populate the second control.
 
Old February 23rd, 2004, 11:01 AM
Friend of Wrox
 
Join Date: Aug 2003
Posts: 205
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Sorry I misread the post. Again in the on validation event of the textbox place the code, however two things:

1. Remember to reference it as form2.textbox.text
2. If Form2 is not loaded make sure to load it first.
 
Old February 23rd, 2004, 11:02 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,151
Thanks: 2
Thanked 14 Times in 14 Posts
Send a message via ICQ to SerranoG Send a message via AIM to SerranoG
Default

Oh, I forgot to mention. Place the code I mentioned in TextBox1's After Update event code.


Greg Serrano
Michigan Dept. of Environmental Quality, Air Quality Division
 
Old February 25th, 2004, 01:29 AM
Registered User
 
Join Date: Feb 2004
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

OIC......
thankyou,
let me try try.......
cause i come from hongkong......and i am a chinese..
not very good in eng!

 
Old July 14th, 2005, 08:10 AM
Registered User
 
Join Date: May 2005
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Did you get your form to work? If so, can you tell me how?

 
Old July 21st, 2005, 05:35 AM
Authorized User
 
Join Date: Dec 2004
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Try this

Private Sub Form_Load()'shld b in form1
Form2.Show
End Sub

Private Sub Text1_Change()
Form2.Text1 = Text1.Text
End Sub


Private Sub Text1_Change()'shld b in form2
Form1.Text1 = Text1.Text
End Sub



Quote:
quote:Originally posted by pactite
 Did you get your form to work? If so, can you tell me how?






Similar Threads
Thread Thread Starter Forum Replies Last Post
passing unique record from form to form Baconant Beginning VB 6 1 January 2nd, 2008 06:20 PM
Form Textbox problem Simba Other Programming Languages 0 February 1st, 2007 05:44 PM
parent child form data passing maddy137 ASP.NET 1.0 and 1.1 Basics 0 April 26th, 2006 01:00 PM
Passing FORM to FORM to PHP AV1611 PHP Databases 1 August 17th, 2005 03:32 PM
Passing Value from main form to Popup Form smartgir Access VBA 0 February 26th, 2004 06:26 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.