Results 1 to 9 of 9

Thread: Text from Form to Form...??!!

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Aug 2006
    Posts
    249

    Unhappy Text from Form to Form...??!!

    yes, how would i get text from one textbox to automaticlly copy and insert the same text into a another Form. Example: I type "hello" in textbox1 which is located in Form1 then i press ''ok'' then "hello" is automatically copy and inserted into textbox2 in Form2 (kind of like duplicating the text). How would i do this? Please Help!!

  2. #2
    PowerPoster jcis's Avatar
    Join Date
    Jan 2003
    Location
    Argentina
    Posts
    4,430

    Re: Text from Form to Form...??!!

    VB Code:
    1. Form2.textbox2.Text = textbox1.Text

  3. #3
    Interweb adm/o/distrator Paul M's Avatar
    Join Date
    Nov 2006
    Location
    Australia, Melbourne
    Posts
    2,306

    Re: Text from Form to Form...??!!

    To quick for me jcis

  4. #4

    Thread Starter
    Addicted Member
    Join Date
    Aug 2006
    Posts
    249

    Unhappy Re: Text from Form to Form...??!!

    no, it aint working ...

  5. #5
    Frenzied Member wiz126's Avatar
    Join Date
    Jul 2005
    Location
    Mars,Milky Way... Chit Chat Posts: 5,733
    Posts
    1,080

    Re: Text from Form to Form...??!!

    You might want to consider declaring the variable in a module (Right click in the treeview -> add Module)
    writing something like this.
    VB Code:
    1. Public txtWord As String

    and you can set what txtword is from any form.

    Quote Originally Posted by anthony_pacitto3
    no, it aint working ...
    You might wanna try placeing the code under Private Sub Text1_Change()
    Last edited by wiz126; Jan 20th, 2007 at 12:03 AM.
    1) If your post has been adequately answered please click in your post on "Mark Thread Resolved".
    2) If someone has been useful to you please show your respect by rating their posts.
    3) Please use [highlight="VB"] 'your code goes in here [/highlight] tags when posting code.
    4) Before posting your question, make sure you checked this links:
    MICROSOFT MSDN -- VB FORUMS SEARCH

    5)Support Classic VB - A PETITION TO MICROSOFT

    ___________________________________________________________________________________
    THINGS TO KNOW ABOUT VB: || VB Examples/Demos
    What are Classes?
    || -
    Where to place a sub/function?(global) || Webbrowser control

  6. #6

    Thread Starter
    Addicted Member
    Join Date
    Aug 2006
    Posts
    249

    Unhappy Re: Text from Form to Form...??!!

    Ok, iv found it out i just had to switch the code around . Thanx

  7. #7
    Interweb adm/o/distrator Paul M's Avatar
    Join Date
    Nov 2006
    Location
    Australia, Melbourne
    Posts
    2,306

    Re: Text from Form to Form...??!!

    you probably have different command names for the text boxes. Has to be something simple it works fine for me

  8. #8
    Frenzied Member zynder's Avatar
    Join Date
    Nov 2006
    Location
    localhost
    Posts
    1,434

    Re: Text from Form to Form...??!!

    Perhaps....

    VB Code:
    1. Private Sub Form_Load()
    2.     Form2.Show
    3. End Sub
    4.  
    5. Private Sub Text1_Change()
    6.     Form2.Text1.Text = Form1.Text1.Text
    7. End Sub

    No buttons needed. It'll automatically copy the text to another form.

  9. #9
    Interweb adm/o/distrator Paul M's Avatar
    Join Date
    Nov 2006
    Location
    Australia, Melbourne
    Posts
    2,306

    Re: Text from Form to Form...??!!

    kk could you resolve this topic just so i don't get confused
    And sorry that sounds like an admin which i am not

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width