How to reset focus on a textbox OnLostFocus

  • Thread starter Thread starter Danny
  • Start date Start date
D

Danny

I am trying to error check what the user has entered in a
text box right when the user tries to lose focus on the
textbox. When the data entered is correct it populates
some other fields but what was entered was wrong, I clear
the textbox and I would like to reset focus on the
textbox so the user can reenter another number.
I tried clearing the textbox and .setfocus right after
but the focus just continues to the next tab order.

Is there anyway I can reset focus?

Thanks,
Danny
 
Use the BeforeUpdate event of the textbox, not the OnLostFocus event. The
BeforeUpdate event has a Cancel argument, which allows you to cancel the
update and keep the focus in the textbox.
 
Back
Top