Checking for a selcted field

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I would like to know if thereis a way to check a set of records to see if a particular field is set to true more than once. Example: If I have a set of customers in a table and only one can be set as active. If I set a customer to active I need to know if there are any other customers set to active. Thsi shgould either allow me to not set it and give me warning.
 
Consider creating a query that adds up the sum of the T/F field (I'm
assuming you have a Yes/No data type). Since "False" is 0, any total
greater than 1 (use the Absolute value function to convert Access values
of -1 -- SQL Server uses +1) indicates more than one check.
 
This may trigger a discussion, but I prefer to have a seperate table with 1
record only for this kind of check containing in this case the ID of the
active customer...

Pieter
 
Pieter

That sounds like a workable solution as well. In this instance, the
trade-off might be the overhead of having a field in a table for which only
one row can be "True", vs. the overhead of an extra table and marshaling an
ID back and forth.

Whatever floats your boat! (as a friend is wont to say...)

Jeff Boyce
<Access MVP>
 
Back
Top