Inserting a radio button in a document

  • Thread starter Re: Inserting an option button in Word
  • Start date
R

Re: Inserting an option button in Word

I'd like to be able to use option buttons in a document that I can click on
to turn on or off. I don't know what the macro code is to do this when I
insert one from control toolbox. Any assistance much appreciated. Using Word
2003
 
J

Jay Freedman

Re: Inserting an option button in Word said:
I'd like to be able to use option buttons in a document that I can
click on to turn on or off. I don't know what the macro code is to do
this when I insert one from control toolbox. Any assistance much
appreciated. Using Word 2003

You don't need any macro code to make the option buttons from the toolbox
turn on and off. You need code only if the user's selection has to make some
other change in the document (for example, displaying or hiding a section of
the text, or populating a combo box with a different set of entries).

To make two or more option buttons behave as a group (turning one on causes
all the others in the group to turn off), enter the same value in the
GroupName property of each button in the group. If you have separate groups,
each group needs a distinct value of GroupName.
 
J

Jay Freedman

Let's start easy, with two rows of 4 buttons. In the first row, open
the properties of the first button, and in the slot next to GroupName
type in Row1 and press Enter. Open the properties of the second
button in the same row, and next to GroupName type in Row1 and press
Enter. Do the same for the third and the fourth buttons in the first
row. Now they all belong to the Row1 group.

In the second row, open the properties of the first button, and next
to GroupName type Row2 and press Enter. Open the second button and
type Row2 and press Enter. Do the same for the third and the fourth
buttons in the second row. Now they all belong to the Row2 group.

You can speed things up a little bit. Instead of closing the
Properties dialog for each button and reopening it for the next
button, go to the dropdown at the top of the Properties dialog and
select the name of the next button.
 
R

Re: Inserting an option button in Word

Thanks Jay,
It's working great. However on one row I want person to be able to select
any combination of 7 exams and if they make a mistake in clicking on a button
to be able to deselect it. I see Anand is saying I can't do this unless I pit
two buttons in for each exam. Looks like tick box may be easier option so.

Thank you both for your help.
 
J

Jay Freedman

That's the essential reason for having the two different kinds of
controls:

- Option buttons are for a situation where the user can choose
*exactly one* of a set of options.

- Check boxes are for a situation where the user can choose zero, one,
or more in any combination.

Trying to use one kind of control in the situation that calls for the
other kind will always cause trouble for you as a programmer and for
the poor confused user. Even users who wouldn't be able to state the
difference will tell you "something isn't right".
 

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