Option button enabled when tabbed to - how?

P

Philip

In a user form I have several Option Buttons and users can tab down them.
What I would like to do,but can't find way, is for each button's Enabled
property to change to True when tabbed to.

It's not life threatening but it is infuriating!

Any help would be appreciated
 
P

Philip

My apologies for misleading everyone

I believe it's the Value property that when set to True the button is
selected and if False, then it's not
So it would be the value property I would like to change when the button is
tabbed to

Philip
 
D

Dave Peterson

I don't understand why you'd want to do this.

If you're using optionbuttons, then I would guess that you have multiple options
that are "grouped". So tabbing to one of the group would make that
optionbutton's value true -- and turn off the one that was previously chosen.

Personally, I just tab to the optionbutton I want to change and hit the spacebar.

I wouldn't do this, but you could tie into the _enter event and do what you want.

I created a userform with 5 optionbuttons and this was the code behind the userform:

Option Explicit
Private Sub OptionButton1_Enter()
Me.OptionButton1.Value = True
End Sub
Private Sub OptionButton2_Enter()
Me.OptionButton2.Value = True
End Sub
Private Sub OptionButton3_Enter()
Me.OptionButton3.Value = True
End Sub
Private Sub OptionButton4_Enter()
Me.OptionButton4.Value = True
End Sub
Private Sub OptionButton5_Enter()
Me.OptionButton5.Value = True
End Sub
 
P

Philip

Thanks for that Dave
I see what you are getting at. I think I will use your space bar tip

Thanks
 

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

Top