View Full Version : IIf Statement Multi select


Gary Eck
07-13-2005, 12:24 PM
I have multiple codes assigned to records in a table. I want to be able to say IIf [code] = "FMIX",[qty]*2.2046/7.1, IIf [code] = "Liqd", [qty]*2.2046 and everything else can just equal [qty]. I have tried this statment Expr1: IIf([family-code]="FMIX",[SumOfqty-on-hand]*2.2046 IIf([family-code]="LIQD",<[SumOfqty-on-hand]*2.2046>,[SumOfqty-on-hand]),[SumOfqty-on-hand]) and it doesn't work. Can anyone tell me what is wrong?

WayneRyan
07-13-2005, 12:33 PM
Gary,


My VBA translation:

If "FMIX"
[SumOfqty-on-hand] * 2.2046
ElseIF "LIQD"
[SumOfqty-on-hand] * 2.2046
Else
[SumOfqty-on-hand]
End If

Convert to IIf:

Expr1: IIf([family-code] = "FMIX",
[SumOfqty-on-hand] * 2.2046,
IIf([family-code] = "LIQD",
[SumOfqty-on-hand] * 2.2046,
[SumOfqty-on-hand]))

Could also be:

Expr1: IIf([family-code] In ("FMIX","LIQD"),
[SumOfqty-on-hand] * 2.2046,
[SumOfqty-on-hand])


Wayne

Gary Eck
07-13-2005, 12:57 PM
You the man. That worked perfect. Thank you