+ Reply to Thread
Results 1 to 6 of 6

Moving Data between two userforms

  1. #1
    Registered User
    Join Date
    03-11-2008
    Posts
    34

    Moving Data between two userforms

    Hello all,

    I am new to programming in VBA and using userforms (but learning by doing!). I am trying to do what I have quoted below. In particular,I have the two userforms set up so that I open one and then click a checkbox that opens the second userform. I would like the data I enter into a texbox in the second userform to populate a text box in the first. Could someone help me with some general code to do this?


    Quote Originally Posted by dominicb View Post
    Good evening scott92

    Sounds like you want to dump the contents of textbox1 into a public variable and force textbox 2 to pick them up from there. You might have a problem deciding exactly when textbox2 is to update - ie what event you're going to hang it from.

    Are both userforms visible on the screen at the same time? is the updating to take place in real time?

    HTH

    DominicB
    Thanks for any help
    Last edited by sportsranker; 08-16-2009 at 04:08 PM.

  2. #2
    Forum Expert Paul's Avatar
    Join Date
    02-05-2007
    Location
    Wisconsin
    MS-Off Ver
    2016/365
    Posts
    6,887

    Re: Moving Data between two userforms

    Hello Sportsranker,

    I don't see why you couldn't use something as simple as:
    Please Login or Register  to view this content.
    When you type something into TextBox2 on UserForm2 and then exit that textbox, TextBox1 on UserForm1 will update appropriately.

    Hope that helps!

  3. #3
    Forum Expert pike's Avatar
    Join Date
    12-11-2005
    Location
    Alstonville, Australia
    MS-Off Ver
    2016
    Posts
    5,342

    Re: Moving Data between two userforms

    maybe...
    in module
    Please Login or Register  to view this content.
    in userfrom one
    Please Login or Register  to view this content.
    userform two
    Please Login or Register  to view this content.
    If the solution helped please donate to RSPCA

    Site worth visiting: Rabbitohs

  4. #4
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Moving Data between two userforms

    In cases like this I would suggest you consider using one userform, with a multipage contro.
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  5. #5
    Registered User
    Join Date
    03-11-2008
    Posts
    34

    Re: Moving Data between two userforms

    Thanks everyone. This should work.

  6. #6
    Forum Expert pike's Avatar
    Join Date
    12-11-2005
    Location
    Alstonville, Australia
    MS-Off Ver
    2016
    Posts
    5,342

    Re: Moving Data between two userforms

    hi sportsranker
    dont forget to go back to your first post > Edit > Go Advanced and change the prefix to "Solved"

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1