+ Reply to Thread
Results 1 to 7 of 7

Unloading Forms

  1. #1
    Registered User
    Join Date
    02-20-2012
    Location
    Texas
    MS-Off Ver
    Excel 2010
    Posts
    8

    Unloading Forms

    I have two forms in ActiveX:

    (1) MainForm
    (2) UserForm2

    When the program initiates, MainForm is the first thing the user sees. If they click a particular button, then UserForm2 appears.
    In UserForm2 I have a textbox and two buttons ("Cancel", "Add Vendor"). I want to make it such that if the user presses "Cancel", UserForm2 will disappear and guide them back to MainForm exactly how they left it.

    My problem is that

    Please Login or Register  to view this content.
    will exit BOTH forms, I need it to only exit out of UserForm2. I've also tried Unload UserForm2 but received an error.

    Any Suggestions?

  2. #2
    Valued Forum Contributor john55's Avatar
    Join Date
    10-23-2010
    Location
    Europe
    MS-Off Ver
    Excel for Microsoft 365
    Posts
    2,028

    Re: Unloading Forms

    not sure but in cancel code button you can try this
    Please Login or Register  to view this content.
    Regards, John55
    If you have issues with Code I've provided, I appreciate your feedback.
    In the event Code provided resolves your issue, please mark your Thread as SOLVED.
    If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.

    ...enjoy -funny parrots-

  3. #3
    Registered User
    Join Date
    02-20-2012
    Location
    Texas
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: Unloading Forms

    Hi John,
    It was a good try but it still exits both.

  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: Unloading Forms

    UserForm1 needs to be Hidden not closed.

    On UserForm1 add a button with this code
    Please Login or Register  to view this content.
    In UserForm2

    Please Login or Register  to view this content.
    Hope that helps.

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

    Free DataBaseForm example

  5. #5
    Valued Forum Contributor john55's Avatar
    Join Date
    10-23-2010
    Location
    Europe
    MS-Off Ver
    Excel for Microsoft 365
    Posts
    2,028

    Re: Unloading Forms

    hi dfaunce83
    it's hard to say what is happening there, could you make a test file with the issue and upload it here?
    maybe someone gives you a solution

    __sorry Roy!
    did not see yr solution!
    Last edited by john55; 02-27-2012 at 11:06 AM. Reason: oops!

  6. #6
    Registered User
    Join Date
    02-20-2012
    Location
    Texas
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: Unloading Forms

    royUK,

    Thank you, this is perfect. My other option was to use an inputbox, but this works great.

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

    Re: Unloading Forms

    Your post does not comply with Rule 9 of our Forum RULES. If you solve a problem yourself before anyone else has responded, please take a moment to describe your solution, chances are some other member will benefit. And please never edit a thread in which someone else has responded.


    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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