Trouble with Multiple IIF conditions

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

Guest

I have tried everything I can think of to make this work....I have a list of
employees that need to be matched up with an employment status. I cannot
just add it to my table because it is linked to other employee databases that
I do not have authority to change. I don't know what else to try, the
following all works with the exception of the OR portion. The employee
#00091277 just keeps defaulting to RFT, like it is skipping the OR statement
and evaluating it as false.

EmpStatus: IIf([Update RFT Employee #]![Employee]="00091360" Or [Update RFT
Employee #]![Employee]="00091277","Miscellaneous","RFT")
 
EmpStatus: IIf([Update RFT Employee #]![Employee]="00091360",
"Miscellaneous", IIf [Update RFT Employee
#]![Employee]="00091277","Miscellaneous","RFT"))
 
Another option:

EmpStatus: IIf([Update RFT Employee #]![Employee] IN ("00091360",
"00091277") ,"Miscellaneous","RFT")

Dale
 
Thanks for your response, but I still can't get this working. I have
attempted every combination I can think of, used AND, OR, and keep getting
the same result as seen below. Does sort order matter?

ID Name Number Shift EmpStatus
126 Engineers 00000000 1 RFT
127 Dave H 00090182 1 RFT
128 Tony W 00090670 1 RFT
129 Terry C 00090918 1 RFT
130 Tom H 00090986 1 RFT
131 Leonard D 00091041 1 RFT
132 Doug L 00091228 1 RFT
133 Ellen C 00091360 1 Miscellaneous
134 Mark H 00091611 1 RFT
333 Jera W 00091277 1 RFT


Jerry Whittle said:
EmpStatus: IIf([Update RFT Employee #]![Employee]="00091360",
"Miscellaneous", IIf [Update RFT Employee
#]![Employee]="00091277","Miscellaneous","RFT"))
--
Jerry Whittle, Microsoft Access MVP
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.

jeremiah said:
I have tried everything I can think of to make this work....I have a list of
employees that need to be matched up with an employment status. I cannot
just add it to my table because it is linked to other employee databases that
I do not have authority to change. I don't know what else to try, the
following all works with the exception of the OR portion. The employee
#00091277 just keeps defaulting to RFT, like it is skipping the OR statement
and evaluating it as false.

EmpStatus: IIf([Update RFT Employee #]![Employee]="00091360" Or [Update RFT
Employee #]![Employee]="00091277","Miscellaneous","RFT")
 
I knew it was something that I had missed, alas! After racking my brain I
realized that I imported the 00091277 number from a different source that had
spaces at the end, once I trimmed those spaces it worked as it should. Thank
you both so much for your help.

Dale Fye said:
Another option:

EmpStatus: IIf([Update RFT Employee #]![Employee] IN ("00091360",
"00091277") ,"Miscellaneous","RFT")

Dale

--
Email address is not valid.
Please reply to newsgroup only.


jeremiah said:
I have tried everything I can think of to make this work....I have a list of
employees that need to be matched up with an employment status. I cannot
just add it to my table because it is linked to other employee databases that
I do not have authority to change. I don't know what else to try, the
following all works with the exception of the OR portion. The employee
#00091277 just keeps defaulting to RFT, like it is skipping the OR statement
and evaluating it as false.

EmpStatus: IIf([Update RFT Employee #]![Employee]="00091360" Or [Update RFT
Employee #]![Employee]="00091277","Miscellaneous","RFT")
 
Back
Top