> > I have 8 Option Buttons on a user form. I would like to require 1 to be
> > selected.
[quoted text clipped - 14 lines]
> indicating which was the last one selected. This would provide an easy means to be
> sure one had been chosen before the form is dismissed.
Put all of the Option Buttons in a Frame to which you give a name, then use
the following in the Command Button Click event, (replacing the[FrameName]
with the name that you assigned to the Frame):
Dim checked as Boolean
Dim acontrol as Control
checked = False
For i = 1 To 8
Set acontrol = [FrameName].Controls(i - 1)
If acontrol.Value = True Then
checked = True
End If
Next i
If checked = False Then
MsgBox " you must select an option button"
End If

Signature
Hope this helps.
Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.
Doug Robbins - Word MVP
> Thanks for repliing Karl any chance i could get a snippet from you? i am
> still pretty new to this.
[quoted text clipped - 21 lines]
>> means to be
>> sure one had been chosen before the form is dismissed.
Office_Novice - 11 Feb 2008 13:28 GMT
That was perfect thnks.
> Put all of the Option Buttons in a Frame to which you give a name, then use
> the following in the Command Button Click event, (replacing the[FrameName]
[quoted text clipped - 38 lines]
> >> means to be
> >> sure one had been chosen before the form is dismissed.