Thank you. That works for two choices, but I was hoping for something that
works more like Access, where a frame takes on the value of alternate choices
within.
Is there a reason you're using check boxes instead of option buttons,
which normally behave exclusively?
A frame in a userform doesn't take on the value of anything -- it
doesn't even have a .Value property -- but you can use it as a
container. If you put any number of option buttons in a frame on a
userform, you can run code similar to this:
Private Sub CommandButton1_Click()
Dim i As Integer
For i = 0 To Frame1.Controls.Count - 1
If Frame1.Controls(i).Value Then
' do something with the selected one
MsgBox Frame1.Controls(i).Caption
Exit For
End If
Next i
Unload Me
End Sub
--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org
>Thank you. That works for two choices, but I was hoping for something that
>works more like Access, where a frame takes on the value of alternate choices
[quoted text clipped - 23 lines]
>> > Sub. These did not work and I could not find better on-line help. I would
>> > appreciate someone's help with this. Thank you.
richardb - 11 Oct 2005 14:29 GMT
Jay, I should have referred to an "Option Group" as in Access, not a frame. I
don't find an option group in Word VBA. I also have not figured out how to
put toggle buttons on a user form so they alternate. I'd be grateful for a
tip and otherwise the solutions already provided will work nicely thank you.
> Is there a reason you're using check boxes instead of option buttons,
> which normally behave exclusively?
[quoted text clipped - 48 lines]
> >> > Sub. These did not work and I could not find better on-line help. I would
> >> > appreciate someone's help with this. Thank you.
Jay Freedman - 11 Oct 2005 16:30 GMT
There isn't an "option group" control in Word VBA as such, but there are two
ways to create something that works the same way. They're described in the
VBA Help topic "
Ways to create an option group
". One way is to use a frame, together with code like that I already showed.
The other way is to use the GroupName property of each option button.

Signature
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org
> Jay, I should have referred to an "Option Group" as in Access, not a
> frame. I don't find an option group in Word VBA. I also have not
[quoted text clipped - 60 lines]
>>>>> on-line help. I would appreciate someone's help with this. Thank
>>>>> you.