IIf Statement Multi select

Gary Eck

New member
Local time
Today, 13:40
Joined
Feb 23, 2005
Messages
6
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 [COLOR=Red]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])[/COLOR] and it doesn't work. Can anyone tell me what is wrong?
 
Gary,

Code:
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
 
You the man. That worked perfect. Thank you
 

Users who are viewing this thread

Back
Top Bottom