Resetting option groups

G

Guest

Option groups normally open with the individual option buttons unselected.
How can the group subsequently be reset to return all the buttons to the
non-selected state? I have tried shifting the focus and setting individual
button states to False but without success. Closing and reopening the form
seems to be a bit clumsy.
 
A

Allen Browne

Assign the value Null to the option group.

1. Add another option button to your group.
Set its name to: optNone
Set the Caption of its label to: None of the above.

2. Add this code to the option group's AfterUpdate event procedure (assuming
the option group is named grp1):
Private Sub grp1_AfterUpdate()
With Me.grp1
If .Value = Me.optNone.OptionValue Then
.Value = Null
End If
End With
End Sub
 
G

Guest

Thank you again, as usual, Allen. If I am ever to catch you napping, it
obviously won't be at 0857.

I thought about creating a hidden button but I could not see how to set it.
I will now give your solution a whirl.
 

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