How to set Optionbox value from code?

M

Mark Burns

I have an Excel applciaiton, it reads values from an Access database and
fills in multiple worksheets with the databse information.
One of these worksheets contains a group box with two option boxes labelled
YES and NO respectively.
I need to set these option box values from the database. The option box
controls are NOT bound to any worksheet cells.

I have tried the following:
assess.Shapes("optCommitYES").ControlFormat.Value = msoTrue
(assess is a worksheet object name)
and VBA blows up with an Error 1004: "Unable to set the Value property of
the OptionButton class."

If this were Access, I'd set/retrieve the value through the group box
control, but this is Excel, and things don't work that way here...so hwo do i
set the control(s) value(s) to selected/unselected via code from the db value?
Will I be forced to select one or more cells to bind these option button
controls to (trying to avoid that as it will mean changing already approved
template files yet again), or what?
 
M

Mark Burns

Peter,

Yup - I figured that out myself about 5 minutes after posting the message.
thanks!
 

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