+ Reply to Thread
Results 1 to 9 of 9

Solution to TextBox_Exit bug

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

    Solution to TextBox_Exit bug

    I just discovered the bug in Excel with TextBox_Exit inside a frame. http://www.excelforum.com/excel-prog...t-trigger.html

    I'm wondering if there is anything wrong with this solution.
    Please Login or Register  to view this content.
    I've tested it and the "txtAT.SetFocus" triggers the "TextBox_Exit" that didn't execute properly, then it ignores the "SetFocus" and moves onto the next control outside the Frame. It works going forward and backward through the TabIndex order.

    Is there anything else that I should be concerned with?
    Foxguy

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

  2. #2
    Valued Forum Contributor blane245's Avatar
    Join Date
    02-20-2009
    Location
    Melbourne, FL
    MS-Off Ver
    Excel 2010
    Posts
    649

    Re: Solution to TextBox_Exit bug

    Since it's your bug that you found, you knows better than you what else is hiding in Excel :-)
    Bob
    Click my star if my answer helped you. Mark the thread as [SOLVED] if it has been.

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

    Re: Solution to TextBox_Exit bug

    I just discovered this known bug in Excel.

    My solution has worked so far, but since it's not mentioned in the workaround, I'm concerned that there might be a reason why it's not mentioned. I'm hoping that someone has some experience with it and know why it wasn't mentioned in the workaround.

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

    Re: Solution to TextBox_Exit bug

    I'm confused - that is the workaround mentioned in the KB article (set focus to another control in the frame).
    Remember what the dormouse said
    Feed your head

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

    Re: Solution to TextBox_Exit bug

    I did discover a problem. If Frame_Exit sets focus to the TextBox that didn't have it's Exit execute, it doesn't execute.

    I think I found a solution to that also. I create a TextBox inside the Frame with .Top = -100 and TabIndex = False. Then I SetFocus to that Textbox in the Frame_Exit.

    Anyone have any experience with this known bug, and see anything I've overlooked?

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

    Re: Solution to TextBox_Exit bug

    romperstomper;

    The workaround said to use the commandbutton to set the focus back to a Textbox in the Frame. IOW every control outside the Frame would have to set the focus back to a Textbox in the Frame. That is very inconvenient. I have over 100 controls on the Userform.

    I'm using the Frame_Exit to set the focus back. It seems so obvious, that I'm concerned that it wasn't mentioned in the workaround. It makes me think I've overlooked something.

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

    Re: Solution to TextBox_Exit bug

    The workaround is a simplistic example. The key point is setting focus to another control inside the frame.

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

    Re: Solution to TextBox_Exit bug

    I agree that it's simplistic, but setting the focus back from within the Frame_Exit seems so obvious to me as being a better solution, that I'm afraid I'm missing something. Why didn't the workaround offer the "Better" solution (in my opinion)?

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

    Re: Solution to TextBox_Exit bug

    Since I didn't write it, I can't say!

+ 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