About Option Button Value

  • Thread starter Thread starter March
  • Start date Start date
M

March

Dear All,

I try to get a value (true/false) of option button in order to assign a
value then transfer the value to excel.

I have no idea how to correct my code below

If option1.Value = True Then ---> 'this line I don't really know how to
correct it


xApp.sheets("ExcelSheet").range("K3") = "1"

Else

xApp.sheets("ExcelSheet").range("K3") = "2"

End If


Thanks,

March
 
March

In Microsoft Access forms, "option buttons" are NOT true/false. An option
group has values like 1, 2, 3, ...

In Access forms, a checkbox can be true/false.

Where are you trying to do this?

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
Thank you so much. The answer is helpful. However, how can identify that one
option is selected?
 
I mean for two conditions following the code,

the option button value object should be 1 and 2; if I selected option
button object that has vlaue 1, how can I write the codes that the option
button is selected.

Do you have any idea to suggest?


March
 
For everyone else, the answer is that with an option group, you refer to the
option frame control rather than to the individual options. An option group
returns only a single value regardless of how many options it contains.
 
Back
Top