How to Set an Option Button

  • Thread starter Thread starter onlyng
  • Start date Start date
O

onlyng

It must be trivial Watson but...

I tried this code to refer to an existing Option Button (placed in a
User Form):

Sub HelpMe
Dim oOpt as Control

Set oOpt = Me.Frame1.Controlls("OptionButton1")
...

End Sub

It compiles wiyhout error, but when run it returns error 1004

???
 
Controls has only one L
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware
(Excel Add-ins / Excel Programming)


<[email protected]>
wrote in message
It must be trivial Watson but...
I tried this code to refer to an existing Option Button (placed in a
User Form):

Sub HelpMe
Dim oOpt as Control
Set oOpt = Me.Frame1.Controlls("OptionButton1") ...
End Sub
It compiles wiyhout error, but when run it returns error 1004

???
 
Controls has only one L
--
Jim Cone
San Francisco, USAhttp://www.realezsites.com/bus/primitivesoftware
(Excel Add-ins / Excel Programming)

<[email protected]>
wrote in message
It must be trivial Watson but...
I tried this code to refer to an existing Option Button (placed in a
User Form):

Sub HelpMe
   Dim oOpt as Control
   Set oOpt = Me.Frame1.Controlls("OptionButton1")   ...
End Sub
It compiles wiyhout error, but when run it returns error 1004

???

OK
You win on techinatillllity
However, I still get error 1004 with one "L".
Any serious contribution?
Thanks
 
Try it without the reference to Frame1... the Controls collection belongs to
the UserForm, not the Frame.

Set oOpt = Me.Controls("OptionButton1")

Rick
 

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