TextBox focus 2

T

Tim Coddington

I have a userform with two option buttons and a text box.
I want to have the text box always have the focus.
If I click on an un-selected option button, I can give the
text box focus through TextBox1.Setfocus in the click
event of each option button.
But when I click on a selected option button, the click
event for that option button doesn't appear to fire, and
focus changes to the option button.
Is there some way I can keep the focus on TextBox1
for this scenario?
 
T

Tom Ogilvy

On a userform? (assume so since you are using setfocus).


how about using the enter event to see if the option button is true and if
so, set the focus to the textbox.
 
T

Tim Coddington

Changing my _Click events to _Enter events did help. Thanks, Tom.
There is another problem. When I am in the text box and press <cr>,
(I capture it and process the info in the text box with keypress()), the
text box looses focus. I tried setting focus to TextBox1 in
TextBox1_Exit(), but then, when the form exits, an error is generated.

Any more help available?
 
Top