I need some help with a calculation, it uses; Iif, And, Or.
What I need it to do is; calculate two fields together i.e. [Text137]*[sfrmConditionCOSHH]![txtFireScore]
But there will be times when [txtFireScore] will equal 0, but I need a value from [Text137]. These times are when [Volat] equals either "Powder" or "Below 56ºC"
Here is the current state of the calculation.
=IIf([Volat]="Powder" Or "Below 56ºC" And [sfrmConditionCOSHH]![txtFireScore]=0,[Text137],([Text137]*[sfrmConditionCOSHH]![txtFireScore]))
TIA
Nested Iif question
-
- Administrator
- Posts: 78493
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: Nested Iif question
And has precedence above Or. And you must repeat [Volat]=, so try
=IIf(([Volat]="Powder" Or [Volat]="Below 56ºC") And [sfrmConditionCOSHH]![txtFireScore]=0,[Text137],([Text137]*[sfrmConditionCOSHH]![txtFireScore]))
=IIf(([Volat]="Powder" Or [Volat]="Below 56ºC") And [sfrmConditionCOSHH]![txtFireScore]=0,[Text137],([Text137]*[sfrmConditionCOSHH]![txtFireScore]))
Best wishes,
Hans
Hans
-
- 5StarLounger
- Posts: 736
- Joined: 18 Mar 2010, 11:05
Re: Nested Iif question
Ah, thank you Hans.
That did the trick.
That did the trick.