Setfocus to specific Option Button

  • Thread starter Thread starter Chertsey
  • Start date Start date
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
 
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
 
Back
Top