+ Reply to Thread
Results 1 to 5 of 5

remembering userform

  1. #1
    Registered User
    Join Date
    09-17-2009
    Location
    Galati, Romania
    MS-Off Ver
    Excel 2003
    Posts
    32

    remembering userform

    Hello,

    So i have an 'userform1' with a 3 buttons and a 3 textboxes.
    when i click each button another 'userform2' opens with several textboxes and an OK button where i insert some info. when i click the OK button i want the textbox on the Userform1 to load a certain text.
    The question is how do i make 'userform2' 'understand' in which texbox from 'userform1' to send the text when i press the OK button.

    Thank you!

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

    Re: remembering userform

    I've seen dozens of similar questions, but I can't understand why this situation needs two UserForms. One UserForm with a MultiPage control simplifies the task, other wise you need Global Variables
    Hope that helps.

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

    Free DataBaseForm example

  3. #3
    Registered User
    Join Date
    09-17-2009
    Location
    Galati, Romania
    MS-Off Ver
    Excel 2003
    Posts
    32

    Re: remembering userform

    i've done it, it's easy. you just need to understand the order in which VBA compiles the code in this situation and i used a public variable.
    the problem was i couldn't use multipage.

    Thank you!

  4. #4
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,996

    Re: remembering userform

    If you really need to use two forms, then add a Public textbox variable to the forms you call from the first form and then assign the relevant textbox on form1 to that variable before showing form2.
    Everyone who confuses correlation and causation ends up dead.

  5. #5
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: remembering userform

    Please Login or Register  to view this content.
    Which can also be written as:

    Please Login or Register  to view this content.
    NB. I strongly support RoyUK's opinion on Multipages.



+ 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