check box

  • Thread starter Thread starter jo
  • Start date Start date
J

jo

Hi I have two check boxes on my form, and what I would like to happen is if
one of the check boxes has been selected then the other check box is disabled
so that the user can not check both boxes at the same time? Does any one have
any code that can be put in place to do this?
thanks
Jo
 
Hi I have two check boxes on my form, and what I would like to happen is if
one of the check boxes has been selected then the other check box is disabled
so that the user can not check both boxes at the same time? Does any one have
any code that can be put in place to do this?
thanks
Jo

Put this in Checkbox after update event

if chkbox1.value = true then chkbox2.enabled = false


You can do the same for other Checkbox.
 
Jo -

This sounds like an option group with radio buttons - only one can be
selected, rather than two checkboxes.
 
Hi I have tried as you suggest but the user is not able to deselect if they
have chosen the wrong box?

Private Sub Visual_AfterUpdate()

Visual.Value = False
Calibrated.Enabled = True

End Sub
 
Hi I have tried as you suggest but the user is not able to deselect if they
have chosen the wrong box?

Private Sub Visual_AfterUpdate()

Visual.Value = False
Calibrated.Enabled = True

End Sub

Use an option group instead of 2 separate check boxes.
In an Option Group, only one entry at a time can be selected.
You can use a check box within the group instead of radio buttons if
you wish that look.
Bind the option group to one field in a table.
The Table Field will store the value of the item selected, 1, 2, 3,
etc.

You can then convert the selected value to text in a report using
something like...
=Choose([FieldName],"Shipped","Not Shipped", "Back Ordered")
where the Field value of "Shipped" is 1 and the value of "Not Shipped"
is 2, and "Back Ordered" is 3.
 
Hi I have tried your way but this is the problem I have now. I have the group
box with the 2 checked boxes. Giving the values of 1 or 2, how do I convert
the values to display as check boxes. I have reports that have check box
results on. And the user needs to see which box was last clicked on?
Jo

fredg said:
Hi I have tried as you suggest but the user is not able to deselect if they
have chosen the wrong box?

Private Sub Visual_AfterUpdate()

Visual.Value = False
Calibrated.Enabled = True

End Sub

Use an option group instead of 2 separate check boxes.
In an Option Group, only one entry at a time can be selected.
You can use a check box within the group instead of radio buttons if
you wish that look.
Bind the option group to one field in a table.
The Table Field will store the value of the item selected, 1, 2, 3,
etc.

You can then convert the selected value to text in a report using
something like...
=Choose([FieldName],"Shipped","Not Shipped", "Back Ordered")
where the Field value of "Shipped" is 1 and the value of "Not Shipped"
is 2, and "Back Ordered" is 3.

--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
.
 
Back
Top