Too many nested IIf's. There is a limit on them.
Workarounds:
1. Design an UDF, which returns needed value;
2. Group IIf's with same outcome. Like
Code:
IIf([Controlled Substance Name]="Morphine Oxycodone Mix" OR
[Controlled Substance Name]="Butalbital Codeine Mix" OR
[Controlled Substance Name]="Amphetamine WIP FIN",0,
IIf([UOM]="EA",[Quantity]*[Number of Tabs or Caps per EA]*[Strength]/1000*[Conversion Factor],
IIf([UOM]="KG",[Quantity]*[Percent Active]*1000*[Conversion Factor],[Quantity]*[Percent Active]*[Conversion Factor],
IIf([UOM]="MG",[Quantity]/1000*[Percent Active]*[Conversion Factor])))
3. Group IIfs structually. Like
Code:
IIf([Controlled Substance Name]="Morphine Oxycodone Mix" OR
[Controlled Substance Name]="Butalbital Codeine Mix" OR
[Controlled Substance Name]="Amphetamine WIP FIN",
IIf([Controlled Substance Name]="Morphine Oxycodone Mix",0,
IIF([Controlled Substance Name]="Butalbital Codeine Mix",0,0)),
Iif([UOM]="EA",[Quantity]*[Number of Tabs or Caps per EA]*[Strength]/1000*[Conversion Factor],
IIf([UOM]="KG",[Quantity]*[Percent Active]*1000*[Conversion Factor],[Quantity]*[Percent Active]*[Conversion Factor],[Quantity]/1000*[Percent Active]*[Conversion Factor])))
4. Create a table where all possible combinations and matching return values are defined. Use DLookup to get the value from lookup table.