Option Group

  • Thread starter Thread starter Bryan Hughes
  • Start date Start date
B

Bryan Hughes

Hello,

I have a table that is mainly yes/no fields. On my form created for this
table, it is a bunch of checkboxes bound to the related field. I would
like to make all of the checkboxes, but 1, an option group, so the user can
only check one box. How can I do this?

-Bryan
 
'================================
Function fSetCheckBoxes()

If chkMyCheckBox1 = True Then
chkMyCheckBox2 = False
chkMyCheckBox3 = False
chkMyCheckBox4 = False
ElseIf chkMyCheckBox2 = True Then
chkMyCheckBox1 = False
chkMyCheckBox3 = False
chkMyCheckBox4 = False
ElseIf chkMyCheckBox3 = True Then
chkMyCheckBox1 = False
chkMyCheckBox2 = False
chkMyCheckBox4 = False
ElseIf chkMyCheckBox4 = True Then
chkMyCheckBox1 = False
chkMyCheckBox2 = False
chkMyCheckBox3 = False
End If

End Function
'================================

Should be
'================================
Function fSetCheckBoxes()

If Me.chkMyCheckBox1 = True Then
Me.chkMyCheckBox2 = False
Me.chkMyCheckBox3 = False
Me.chkMyCheckBox4 = False
ElseIf Me.chkMyCheckBox2 = True Then
Me.chkMyCheckBox1 = False
Me.chkMyCheckBox3 = False
Me.chkMyCheckBox4 = False
ElseIf Me.chkMyCheckBox3 = True Then
Me.chkMyCheckBox1 = False
Me.chkMyCheckBox2 = False
Me.chkMyCheckBox4 = False
ElseIf Me.chkMyCheckBox4 = True Then
Me.chkMyCheckBox1 = False
Me.chkMyCheckBox2 = False
Me.chkMyCheckBox3 = False
End If

End Function
'================================

Wayne Gillespie
Gosford NSW Australia
 
Back
Top