Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Check box on a continous form

Status
Not open for further replies.

aspnetuser

Technical User
Sep 9, 2004
273
US
I have a continous form with 6 check boxes. I need to limit the user to only selecting one check box per record. How can I do this?

regards,
 
If you have assigned each check box to a different field then you have a fair bit of coding to do for this.

The usual approach for selecting exclusive options is to use a single field to hold the result and then use an option group control on a form to provide a set of option buttons. The option group wizard will guide you through the process.

 
I can't use the option method. Any guidence on the code I will have to use?

Also, when a check box it clicked, the value in the field is updated to -1. How can I make the value positive 1?
 
for any given checkbox the code will go in the afterupdate event procedure and will look something like:

sub check1_afterupdate()
If me.check1 = true then
me.check2 = false
me.check3 = false
..etc
me.check6 = false
else
end if

end sub

Note that this will allow all checkboxes to be deselected.
If you must always have one checkbox selected then you must prevent deselection of a checkbox.

If you have set up Yes/No fields to hold the checkbox values then the values will be -1 and 0.
This is fixed.












 
thats great,
how do you set the values to be 1 and 0 or did you mean you cannot?

80% of the time all values will be deselected.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top