TextBox focus 2

  • Thread starter Thread starter Tim Coddington
  • Start date Start date
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?
 
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.
 
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?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top