Only allow 1 record to be true for a Yes/No Field

B

Bruce

I have a form displaying table records for which 1 is of type (yes/no). I
have set this up on the form as a checkbox. All ok so far.

However I would like to add some code so that only 1 record can be true at a
time.
For example when I check a record to true, all other records will be set to
false.

Any ideas of how to ahcieve this one?

Bruce
 
P

PC Datasheet

In the Afterupdate event of the checkbox, run an update query that sets the
checkbox to false of all the records in the table whose primary key does not
equal the primary key of the current record.
 
Top