Hi. So I have a userform and let's say it has one textbox, a controlbutton1 and a controlbutton2.
controlbutton1.enabled = false
controlbutton2.enabled = true
at textbox_afterupdate (after pressing Enter or Tab), if the content of the textbox meets the requirements it sets controlbutton1.enabled to true.
The problem I'm having is every time the code gets executed it skips controlbutton1 and sets focus to controlbutton2.
I have tried setting focus (controlbutton1.setfocus) before exiting textbox_afterupdate, didn't work. And yes, the tab orders are correct: textbox (0), controbutton1 (1), controlbutton2 (2).
Any ideas? Thanks in advance.
controlbutton1.enabled = false
controlbutton2.enabled = true
at textbox_afterupdate (after pressing Enter or Tab), if the content of the textbox meets the requirements it sets controlbutton1.enabled to true.
The problem I'm having is every time the code gets executed it skips controlbutton1 and sets focus to controlbutton2.
I have tried setting focus (controlbutton1.setfocus) before exiting textbox_afterupdate, didn't work. And yes, the tab orders are correct: textbox (0), controbutton1 (1), controlbutton2 (2).
Any ideas? Thanks in advance.