Help with IIf statement

  • Thread starter Thread starter DevilDog1978
  • Start date Start date
D

DevilDog1978

I am trying to get the following to work in one of my queries.

ACTION: IIF([DELETE REQUEST FOR MOCC]![MODEL] & [FSCM] &
[SERIAL]=[ISR]![MODEL NUMBER] & [ISR]![CAGE] & [ISR]![SERIAL
NUMBER],"DELETE", IIF([DELETE REQUEST FOR MOCC]![MODEL] & [FSCM] &
[SERIAL]=[ISSUED REPORT]![MODEL NUMBER] & [ISSUED REPORT]![CAGE] & [ISSUED
REPORT]![SERIAL NUMBER],"TRANSFERâ€))

What I am trying to accomplish is any data that is on the Delete Request for
MOCC and on the ISR want it to respond with delete. If the record on Delete
Request for MOCC is also found on the Issued Report, I want it to say
transfer.
 
Each IIf statement needs 3 parts, the statement, what to do if true, what to
do if false.
Your 2nd IIf statement is missing what to do if false.
Here it is in short form

IIF(A=B,"Delete",IIF(A=C,"Transfer",Null))

In long form

IIF([DELETE REQUEST FOR MOCC]![MODEL] & [FSCM] &
[SERIAL]=[ISR]![MODEL NUMBER] & [ISR]![CAGE] & [ISR]![SERIAL
NUMBER],"DELETE",
IIF([DELETE REQUEST FOR MOCC]![MODEL] & [FSCM] &
[SERIAL]=[ISSUED REPORT]![MODEL NUMBER] & [ISSUED REPORT]![CAGE] & [ISSUED
REPORT]![SERIAL NUMBER],"TRANSFER"),"")

I am assuming that you want nothing to happen if both conditions are false.


Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia
 
Back
Top