Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Select option button when have the name as a string
Hi All
During the running of my VBA code, I collect the name of an option button from an Access database. I then want to set the value of the option button on a form. My problem is that I have the name of the button as a string and just cannot see how to use that to set the value of the button on the form as, when used as a string, I get an error. Hope the question makes sense to someone :-) Many thanks Deb -- Message posted via http://www.officekb.com |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Select option button when have the name as a string
Deb,
Use Me.Controls(string_value) with whatever property you want -- HTH Bob Phillips "Debbie Probert via OfficeKB.com" wrote in message ... Hi All During the running of my VBA code, I collect the name of an option button from an Access database. I then want to set the value of the option button on a form. My problem is that I have the name of the button as a string and just cannot see how to use that to set the value of the button on the form as, when used as a string, I get an error. Hope the question makes sense to someone :-) Many thanks Deb -- Message posted via http://www.officekb.com |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Select option button when have the name as a string
Private Sub CommandButton2_Click()
sStr = "Button Name" UserForm1.Optionbutton1.Caption = sStr End Sub I assume by name you mean the name you would see next to the button on the form. -- Regaards, Tom Ogilvy "Debbie Probert via OfficeKB.com" wrote in message ... Hi All During the running of my VBA code, I collect the name of an option button from an Access database. I then want to set the value of the option button on a form. My problem is that I have the name of the button as a string and just cannot see how to use that to set the value of the button on the form as, when used as a string, I get an error. Hope the question makes sense to someone :-) Many thanks Deb -- Message posted via http://www.officekb.com |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Can I select more than one option in a drop down box? | Excel Discussion (Misc queries) | |||
Select Option button unhide row | Excel Discussion (Misc queries) | |||
keep source formatting is not an option in paste option button | Excel Discussion (Misc queries) | |||
Can't select macro button after other button is pressed | Excel Programming | |||
Option buttons to select a row of cells | Excel Programming |