LufiaMaxim
New Member
- Joined
- Jul 13, 2011
- Messages
- 16
Hello all,
I'll try to make this as simple as can be.
I have a textbox (ActiveX control) with a button (also ActiveX) next to it. Currently, I validate the textbox's contents with the textbox's LostFocus event. Works great.
However, with some testing and playing around, I noticed a behaviour I would like to prevent. Basically, it goes like this: If user was in the textbox, and then clicked on the button next to it, do NOT run the validation code (which is its own separate sub).
What's the best way to accomplish this? If I use the button's GetFocus event, can I somehow see where the last focus was?
I'm thinking of accomplishing this with a timer delay, but it seems a rather ... well, inefficient work-around. If I could somehow get the last focus in the button's GetFocus event, that would make things easiest.
What's best way of accomplishing this?
I'll try to make this as simple as can be.
I have a textbox (ActiveX control) with a button (also ActiveX) next to it. Currently, I validate the textbox's contents with the textbox's LostFocus event. Works great.
However, with some testing and playing around, I noticed a behaviour I would like to prevent. Basically, it goes like this: If user was in the textbox, and then clicked on the button next to it, do NOT run the validation code (which is its own separate sub).
What's the best way to accomplish this? If I use the button's GetFocus event, can I somehow see where the last focus was?
I'm thinking of accomplishing this with a timer delay, but it seems a rather ... well, inefficient work-around. If I could somehow get the last focus in the button's GetFocus event, that would make things easiest.
What's best way of accomplishing this?