Help with IIf statement

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.
 
J

Jeanette Cunningham

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top