View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
SMS SMS is offline
external usenet poster
 
Posts: 15
Default Simple SetFocus on userform issue


Oh, sorry... the focus goes to the next control in the tab order.



On Oct 1, 2:24*pm, "JLGWhiz" wrote:
I don't understand the problem. *If you are using the AfterUpdate event,
which occurs by User Interface changes, then the focus should already be on
the control. *What is it doing/or not doing. *Where is the focus after the
event?

"SMS" wrote in message

...



Well, it SOUNDS simple...


Userform with three controls, TextBox1, TextBox2, TextBox3


For TextBox2 ONLY, I have this code:


*Private Sub TextBox2_afterupdate()
* * *counter = counter +1
* * *TextBox2.Text = ""
* * *TextBox2.SetFocus
*End Sub


This is supposed to increment a counter, clear the textbox... and here
is the ****er: SET THE FOCUS BACK TO TEXTBOX2.


This appears to be impossible... I have spent hours on it.


Please help!


Again, the sole goal here is to get the same text box to have focus
when the event is finished.


Thank you SO much...- Hide quoted text -


- Show quoted text -