Code needed for a button that deletes option group selection

A

accessbabe

Need to add a button to my form that will delete (a.k.a. clear) the
selections from an option group (with 4 radio buttons). Option group is
names optAssignments, and the form is named frmHome.

What is the code for this, for Access 2002.

Thanks!
 
F

fredg

Need to add a button to my form that will delete (a.k.a. clear) the
selections from an option group (with 4 radio buttons). Option group is
names optAssignments, and the form is named frmHome.

What is the code for this, for Access 2002.

Thanks!

OptionGroupName = Null

Another method would be to add one more option to the group.

Let's say it's Label caption is "Clear" and the button's value is 5.
Code the OptionGroup's AfterUpdate event:

If Me!OptionGroupName = 5 Then
Me!OptionGroupName = Null
Else
' Do whatever else is needed.
End If

No command button is needed.
 
Top