Text formula

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

Guest

I have 3 separate text fileds on a form, each with three possible entries EG accepted, pending and cancelled. A fourth field needs to calculate an entry based upon what is in the other 3 fields e.g.;

If fields 1, 2 and 3 all contain "Accepted" then box 4 should return "Accepted".
However, if fields 1,2 or 3 contain "Cancelled" then field 4 should return "Cancelled"
However, if fields 1,2 and 3 are either, not all "Accepted" or do not contain "Cancelled " then field 4 should return "Pending".

Can anyone suggest the formula to achieve the above.
 
=IIf([Field1]="Cancelled" Or [Field2]="Cancelled" Or [Field3]="Cancelled", "Cancelled",
IIf([Field1]="Accepted" And [Field2]="Accepted" And [Field3]="Accepted", "Accepted",
"Pending"))

--
Wayne Morgan
Microsoft Access MVP


Alan Phillips said:
I have 3 separate text fileds on a form, each with three possible entries EG accepted,
pending and cancelled. A fourth field needs to calculate an entry based upon what is in
the other 3 fields e.g.;
If fields 1, 2 and 3 all contain "Accepted" then box 4 should return "Accepted".
However, if fields 1,2 or 3 contain "Cancelled" then field 4 should return "Cancelled"
However, if fields 1,2 and 3 are either, not all "Accepted" or do not contain "Cancelled
" then field 4 should return "Pending".
 
Back
Top