+ Reply to Thread
Results 1 to 3 of 3

User Form Control Exit with Frames

  1. #1
    Forum Contributor Rhudi's Avatar
    Join Date
    03-08-2013
    Location
    South Carolina, US
    MS-Off Ver
    Professional Plus 2016 aka Office 365
    Posts
    199

    User Form Control Exit with Frames

    I would like to share what I have learned and perhaps get a tip on best practice.

    I have a User Form with a two Frames (fr) that each contain several Text Boxes (tb).

    The _Enter code works exactly as expected. I wasted a lot of time trying to figure out why the (tb)_Exit code didn't consistently run.

    What I figured out is the (fr)_Exit code supersedes the (tb)_Exit when you click out of the frame. Clicking from (tb) to (tb) within a frame allows the "local" (tb)_Exit to work as expected.

    My workaround is to have the (fr)_Exit code call each (tb)_Exit for the (fr) members.

    I realise this may cause unwanted behavior in some cases, when a particular (tb)_Exit may only need to be trigged when actually exiting that control. My workaround for that is to have a module-level boolean variable that is set True by the (tb)_Enter code. Then my (fr)_Exit will only call a particulr (tb)_Exit if its set flag is true. The (tb)_Exit code will always clear its flag.

    Any ideas?

  2. #2
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,014

    Re: User Form Control Exit with Frames

    I admit having the same frustrations with the Frame control.

    My workaround is to not use the Frame at all. I resort to placing straight lines around the other controls or using command buttons that are reduced to thin lines
    and changed to DISABLED.

    I'll continue to watch your thread to see what others have come up with.

    Cheers.

  3. #3
    Forum Contributor Rhudi's Avatar
    Join Date
    03-08-2013
    Location
    South Carolina, US
    MS-Off Ver
    Professional Plus 2016 aka Office 365
    Posts
    199

    Re: User Form Control Exit with Frames

    There is a certain visual appeal for the OCD in using frames. :P

    What I'm stuck in now is determining where focus lies.

    I have a subroutine in my form that does this:
    Please Login or Register  to view this content.
    What I do not like is the way I had to determine which frame I'm in to then deal with the correct 'Focus' item.

    There has got to be a better wat to determine both the frame and the active control in one step.

+ 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. User form with secret multiple frames
    By Nirmall in forum Excel General
    Replies: 3
    Last Post: 06-12-2016, 04:15 PM
  2. Exit Previous User Form
    By AmirSoft in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-28-2014, 06:50 AM
  3. Validation not allowing user to exit form
    By Damian37 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 07-03-2014, 11:02 AM
  4. [SOLVED] Userform multipage control exit events code execution not completed before next user entry
    By jane serky in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 06-10-2013, 04:39 AM
  5. User Form frames hindering textbox text
    By max57 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-22-2009, 12:33 PM
  6. Exit sub from user form problem...
    By ChrisMattock in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 12-10-2008, 10:54 AM
  7. user form and frames
    By Gixxer_J_97 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-09-2005, 11:06 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