Trying to copy data from one form to another form

Thread Solved

Join Date: Aug 2007
Posts: 15
Reputation: venomocity is an unknown quantity at this point 
Solved Threads: 0
venomocity's Avatar
venomocity venomocity is offline Offline
Newbie Poster

Trying to copy data from one form to another form

 
0
  #1
Aug 14th, 2007
Alright, I have an MCSE and A+ education, but nothing is as confusing as script for VB. Well, I take that back it can be pretty simple but sometimes I just can't see the forrest for the trees. I'm trying to copy the data from a text box named creditbox in form1 and copy into the text box named creditbox in form2 how can I do that? I dont know where to start, but I want it to be copied over as soon as form2 is opened. Both forms will be kept opened so I need a button that can retrieve the data later as well. Please Help!
Last edited by venomocity; Aug 14th, 2007 at 2:58 pm. Reason: Left out some info
Reply With Quote Quick reply to this message  
Join Date: Jul 2007
Posts: 189
Reputation: plusplus is an unknown quantity at this point 
Solved Threads: 16
plusplus plusplus is offline Offline
Junior Poster

Re: Trying to copy data from one form to another form

 
0
  #2
Aug 14th, 2007
form2.creditbox = form1.creditbox
Reply With Quote Quick reply to this message  
Join Date: Jul 2007
Posts: 55
Reputation: atplerry is an unknown quantity at this point 
Solved Threads: 3
atplerry atplerry is offline Offline
Junior Poster in Training

Re: Trying to copy data from one form to another form

 
0
  #3
Aug 14th, 2007
This is no problem but take note the for every control that you have there must be a parent reference that is for the first form form1 when you type form1.text1.text that will give you all the content of the textbox then when you want the content in the next textbox then you equate it to the next textbox that is form2.text2.text= form1.text1.text this will give the textbox it content NB this method is allicable to other control in VB and with that your can do and Undo OK
Reply With Quote Quick reply to this message  
Join Date: Jul 2007
Posts: 189
Reputation: plusplus is an unknown quantity at this point 
Solved Threads: 16
plusplus plusplus is offline Offline
Junior Poster

Re: Trying to copy data from one form to another form

 
0
  #4
Aug 14th, 2007
Originally Posted by plusplus View Post
form2.creditbox = form1.creditbox
Put this in your form_load event of form2
put a commandbutton on the form and put this code in the command_click event
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC