About Option Button Value

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
 
J

Jeff Boyce

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
 
M

March

Thank you so much. The answer is helpful. However, how can identify that one
option is selected?
 
M

March

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
 
P

Pat Hartman

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.
 

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