+ Reply to Thread
Results 1 to 5 of 5

Userform to Userform

  1. #1
    Forum Contributor
    Join Date
    07-07-2017
    Location
    USA
    MS-Off Ver
    2010
    Posts
    510

    Userform to Userform

    Greetings,
    I'm using an Userform ("Vendor_ContactsSetUp") to enter information. Textbox tConatctName ("Private Sub tContactName_Exit(ByVal Cancel As MSForms.ReturnBoolean)") can trigger to open another Useform ("Vendor_ContactsName_Use"). I have a CommandButton on this second Useform. If pressed, I want to close this second Userform and return to the first Userform Textbox tConatctName and clear the value.
    The following code works to close and clear the value. However, it does not return to Textbox tConatctName, the next Textbox is highlighted.
    Please Login or Register  to view this content.

  2. #2
    Valued Forum Contributor MikeVol's Avatar
    Join Date
    12-30-2020
    Location
    Odessa / Ukraine
    MS-Off Ver
    MSO Prof Plus 2021 x64 (En)
    Posts
    570

    Re: Userform to Userform

    Hi @brentjohn. Maybe like this?
    Please Login or Register  to view this content.

  3. #3
    Forum Contributor
    Join Date
    07-07-2017
    Location
    USA
    MS-Off Ver
    2010
    Posts
    510

    Re: Userform to Userform

    MikeVol,
    Thank you for your help. However, it still is going to the next Textbox. I tried changing the Tab order as well.

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

    Re: Userform to Userform

    Do you set Cancel = True in the tContactName_Exit routine?

    By the way, your forms generally should not unload themselves. Whatever code loaded them should unload them.
    Everyone who confuses correlation and causation ends up dead.

  5. #5
    Forum Contributor
    Join Date
    07-07-2017
    Location
    USA
    MS-Off Ver
    2010
    Posts
    510

    Re: Userform to Userform

    rorya,
    Works perfectly!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Userform Launch - show userform when any cell in range on any worksheet is double clicked
    By Armitage2k in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 09-27-2016, 03:38 AM
  2. [SOLVED] Save data from UserForm into Sheet (how to resolve runtime errors in UserForm tutorial)
    By eighty6 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 05-14-2015, 07:41 PM
  3. combining chart userform and data transfer userform into 1 userform
    By H_Kennedy in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 01-04-2014, 07:11 AM
  4. [SOLVED] Excel 2007, Userform Textbox Date Format and Calendar Control Userform
    By riffology in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-03-2014, 06:18 PM
  5. combining chart userform and data transfer userform into 1 userform
    By H_Kennedy in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-03-2014, 12:28 PM
  6. [SOLVED] Open a userform from a userform, but preserve the info in the original userform
    By jfoerch in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-25-2013, 02:38 PM
  7. userform is large.....how to use scrollbar of userform to show all of the userform
    By welchs101 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-05-2010, 04:11 PM

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