>Yes, whe you tabed there is no ActiveControl of the form in When event of the button. I see what you mean when you point to use TYPE() vs VARTYPE(). But I think there is no need to Set oLastActiveControl in the TextBox aftre all if you tabed to Button the Button is LastActive Control.
It depends on what behavior we want to achieve? If we want to always return back to the original control regardless of how we accessed the button (via mouse, keyboard (hot keys or Tab)) when we need to save it in textbox and not in button's when.
If it's not broken, fix it until it is.
My Blog