+ Reply to Thread
Results 1 to 12 of 12

TextBox_Exit event doesn't trigger

  1. #1
    Forum Expert
    Join Date
    03-31-2009
    Location
    Barstow, Ca
    MS-Off Ver
    Excel 2002 & 2007
    Posts
    2,164

    TextBox_Exit event doesn't trigger

    On my form I have a TextBox_Exit that is not executing unless I backup through the TabIndex order.

    If I click Shift+Arrow, the Text_Exit executes, but if I just click Arrow or Enter, it doesn't execute.
    It's in a group of 5 TextBoxes that are handled identically, and are one right after the other in the TabIndex order (this one is the last one in the TabIndex order), and the other 4 work fine, so I know that it's not the code itself.

    Is there any reason, other than a corrupted file that could cause this?

    Actually, I just lost the whole thing. Excel crashed and I didn't have the changes to the userform saved yet, so I get to start over. But I would still be interested in an answer.
    Last edited by foxguy; 09-03-2010 at 02:54 PM.
    Foxguy

    Remember to mark your questions [Solved] and rate the answer(s)
    Forum Rules are Here

  2. #2
    Forum Expert
    Join Date
    03-31-2009
    Location
    Barstow, Ca
    MS-Off Ver
    Excel 2002 & 2007
    Posts
    2,164

    Re: TextBox_Exit event doesn't trigger

    This got even weirder. When Excel crashed and I had to open the file again, the TextBox_Exit sub and code were still there, but the TextBox itself wasn't.

  3. #3
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: TextBox_Exit event doesn't trigger

    Were they in a Frame?
    Remember what the dormouse said
    Feed your head

  4. #4
    Forum Expert
    Join Date
    03-31-2009
    Location
    Barstow, Ca
    MS-Off Ver
    Excel 2002 & 2007
    Posts
    2,164

    Re: TextBox_Exit event doesn't trigger

    Yes they are in a Frame. This particular Textbox wasn't the last one to be put into the Frame, but it is the last one in the TabIndex Order of the Frame. How does that affect things?

    I have the same problem again. Any suggestions on how to fix it? I'm going to try deleting the TextBox and then creating it again.

  5. #5
    Forum Guru shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,659

    Re: TextBox_Exit event doesn't trigger

    I think the frame exit event will preempt the textbox exit event.
    Entia non sunt multiplicanda sine necessitate

  6. #6
    Forum Expert
    Join Date
    03-31-2009
    Location
    Barstow, Ca
    MS-Off Ver
    Excel 2002 & 2007
    Posts
    2,164

    Re: TextBox_Exit event doesn't trigger

    This is really getting to me.

    There is no Frame_Exit sub. There are no Frame subs at all.

    I just deleted the TextBox and recreated it, and I still have the same problem.

  7. #7
    Forum Guru shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,659

    Re: TextBox_Exit event doesn't trigger

    There is no Frame_Exit sub
    That you are not subscribed does not mean that the subscription is not available

  8. #8
    Forum Expert
    Join Date
    03-31-2009
    Location
    Barstow, Ca
    MS-Off Ver
    Excel 2002 & 2007
    Posts
    2,164

    Re: TextBox_Exit event doesn't trigger

    I just changed the TabIndex order and selected a different TextBox as the last one in the Frame and sure enough, it's Exit sub does not execute.

    I'm reaching the conclusion that the last Exit sub inside a Frame doesn't execute even though there is no Frame_Exit. I assume that is a bug in Excel.

  9. #9
    Forum Guru shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,659

    Re: TextBox_Exit event doesn't trigger

    It was a bug going back to Excel 2000 (http://support.microsoft.com/kb/210734). Apparently it persists.

  10. #10
    Forum Expert
    Join Date
    03-31-2009
    Location
    Barstow, Ca
    MS-Off Ver
    Excel 2002 & 2007
    Posts
    2,164

    Re: TextBox_Exit event doesn't trigger

    Thanks for the link. Now I have to figure out how to apply the workaround in my situation.
    They only talk about the situation where the user clicks a control outside the Frame. It also doesn't work without clicking a control, just exiting the Frame during normal data entry causes the problem.

  11. #11
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: TextBox_Exit event doesn't trigger

    It's not how you leave the frame that's the issue, it's moving focus to a control outside the frame. Do you actually need the textboxes in a frame?

  12. #12
    Forum Expert
    Join Date
    03-31-2009
    Location
    Barstow, Ca
    MS-Off Ver
    Excel 2002 & 2007
    Posts
    2,164

    Re: TextBox_Exit event doesn't trigger

    I don't actually have to have the frame, but it has 22 controls inside it, and I need to hide them all depending on answers to other questions. It's so much easier to just "Frame.Visible = False", rather than having to hide them all individually. And having the Frame there is visually better, since these controls are logically grouped together.

    I think I found a solution and I posted it on another thread to see if anyone can see a problem with it. http://www.excelforum.com/excel-prog..._exit-bug.html

+ 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