How DO I Create A Field That Checks 4 Other Fields For More Than 1

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

Guest

I have four fields with Yes/No check boxes, I would like to create a fifth
that is Yes/No If More than one of these boxes are checked.

I am using this for a report, so if there is a way of doing it straight into
that, that would ideal!

Below is the Boolean logic (With a Hint Of C++!) for what I need, I just
have no clue on how to implement it in Access 2003!

IF((A.B'.C'.D') Or (A'.B.C'.D') Or (A'.B'.C.D') Or (A'.B'.C'.D))
F="NO"

ELSE
F="YES"
 
hi Jack,
I have four fields with Yes/No check boxes, I would like to create a fifth
that is Yes/No If More than one of these boxes are checked.

I am using this for a report, so if there is a way of doing it straight into
that, that would ideal!

Below is the Boolean logic (With a Hint Of C++!) for what I need, I just
have no clue on how to implement it in Access 2003!

IF((A.B'.C'.D') Or (A'.B.C'.D') Or (A'.B'.C.D') Or (A'.B'.C'.D))
F="NO"

ELSE
F="YES"

SELECT a, b, c, d, (a+b+c+d>-1) AS MoreThanOne
FROM Table

mfG
--> stefan <--
 
hi Stefan,

Stefan said:
SELECT a, b, c, d, (a+b+c+d>-1) AS MoreThanOne
FROM Table
Must be

(a+b+c+d<-1) AS MoreThanOne

because True(Yes) is -1.


mfG
--> stefan <--
 
I have four fields with Yes/No check boxes, I would like to create a fifth
that is Yes/No If More than one of these boxes are checked.

I am using this for a report, so if there is a way of doing it straight into
that, that would ideal!

Below is the Boolean logic (With a Hint Of C++!) for what I need, I just
have no clue on how to implement it in Access 2003!

IF((A.B'.C'.D') Or (A'.B.C'.D') Or (A'.B'.C.D') Or (A'.B'.C'.D))
F="NO"

ELSE
F="YES"

You can take advantage of the fact that in Access, True is stored as
-1, False as 0.

Just set the COntrol Source of the fifth textbox to

(1 + [A] + + [C] + [D]) < 0

or for a less application-dependent but less efficient way:

=IIF(IIF([A], 1, 0) + IIF(, 1, 0) + IIF([C], 1, 0) + IIF([D], 1, 0)
1, True, False)

John W. Vinson[MVP]
 
Back
Top