Setfocus to specific Option Button

C

Chertsey

I have an option group with three option buttons in it. In the OnClick event
I have a Select Case code that runs and there are three cases. If when case
two or three are selected and the code reaches a certain point, I want to set
the option group to it's default wich is Case 1 and have the Button1
selected. How can this be done. I've tried "Screen.PreviousControl.Setfocus"
but it doesn't work. Please help.
Thanks
 
D

Dirk Goldgar

Chertsey said:
I have an option group with three option buttons in it. In the OnClick
event
I have a Select Case code that runs and there are three cases. If when
case
two or three are selected and the code reaches a certain point, I want to
set
the option group to it's default wich is Case 1 and have the Button1
selected. How can this be done. I've tried
"Screen.PreviousControl.Setfocus"
but it doesn't work.

You can't set the focus directly to the option button, but you can set the
value of the option frame and set the focus to the frame. For example:

With Me.Frame0
.Value = Me.OptionButton1.OptionValue
.SetFocus
End With
 

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