IIf function

K

Kali

Does anyone know how I can make this If statement simplier? I want it to
display 4 if the cells shows "acquistion" etc... and otherwise blank.

IIf([TRANS_TYPE]="ACQUISITION",4,IIf([TRANS_TYPE]="ADDITIONS",1,IIf([TRANS_TYPE]="DEPR EXPENSE",2,"")))
 
J

Jeff Boyce

(note - Access doesn't have "cells")

IIF([Trans_Type] = "Acquisition", 4, "")

By the way, consider creating a table of valid [Trans_Type] values, and
their corresponding (whatever '4' is). Then you won't have to locate all
your IIF() statements when things change!

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
C

Clifford Bass

Hi Kali,

Definitely a code table as Jeff mentioned. However, without a code
table you can use the Switch() function.

Switch([TRANS_TYPE]="ACQUISITION",4,[TRANS_TYPE]="ADDITIONS",1,[TRANS_TYPE]="DEPR EXPENSE",2,true,"")

Clifford Bass
 

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

Similar Threads


Top