getting focus on an optionbutton

  • Thread starter Thread starter Len
  • Start date Start date
L

Len

I have a userform with three text boxes and nine
optionbuttons. The optionbuttons are in one group. When I
tab through the optionbuttons I want the focus to move
from one optionbutton to another and have the optionbutton
take focus (i.e. get the dot in the button). Tabbing
causes the caption on the optionbutton to be highlighted
but the option button actually does not get focus (i.e.
OptionButton1.Value = False). I want "OptionButton1.Value
= True" to occur when I tab to the optionbutton. How do I
get this to happen? Is this possible?
 
Hi

Private Sub OptionButton1_Enter()
OptionButton1.Value = True
End Sub

Private Sub OptionButton2_Enter()
OptionButton2.Value = True
End Sub

HTH. Best wishes Harald
 
Harald showed you how to do what you requested, but just to clarify, getting
focus doesn't involve changing the value. the control has the focus when
you tab to it.
 
Yes, that works!!!

Thanks Harald Staff

Len
-----Original Message-----
Hi

Private Sub OptionButton1_Enter()
OptionButton1.Value = True
End Sub

Private Sub OptionButton2_Enter()
OptionButton2.Value = True
End Sub

HTH. Best wishes Harald

"Len" <[email protected]> skrev i melding


.
 

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