How to set the default value to "not selected" for all option but.

S

satori

How do you to set the default value to "not selected" for all option buttons,
in a group, on a word form?

Thank You.
 
H

Helmut Weber

Hi,
if is it really the default value,
then I would do it manually in the properties window.
If you would like to set the values of all
optionbuttons in a group to false,
after a user e.g. has checked one button,
then one way would be to access the groupname property.
Of course, there must be a groupname beforehand
and all optionbuttons in the group (in the frame)
have to have the same groupname.
Then like this:
Private Sub CommandButton1_Click()
Dim oCnt As Control
For Each oCnt In Me.Controls
If TypeOf oCnt Is OptionButton Then
If oCnt.GroupName = "Group1" Then
oCnt.Value = False
End If
End If
Next
End Sub
 

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