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.
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.Private Sub FrameAbilities_Exit(ByVal Cancel As MSForms.ReturnBoolean) txtAT.SetFocus 'Textbox inside the Frame End Sub
Is there anything else that I should be concerned with?
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.
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.
I'm confused - that is the workaround mentioned in the KB article (set focus to another control in the frame).
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?
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.
The workaround is a simplistic example. The key point is setting focus to another control inside the frame.
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)?
Since I didn't write it, I can't say!
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks