I the expression below is not working giving #error result if txtTotalFixedAsset3 has 0
=IIf(ReportItems!txtTotalFixedAsset3.Value<> 0 ,(ReportItems!txtTotalFixedAsset.Value /ReportItems!txtTotalFixedAsset3.Value)*100 , 0)
what am i going wrong?
=IIf(ReportItems!txtTotalFixedAsset3.Value<> cDec(0) ,(ReportItems!txtTotalFixedAsset.Value /ReportItems!txtTotalFixedAsset3.Value)*100 ,cDec(0))
I also tried this. but no success. txtTotalFixedAsset3 value is of type decimal.
It may be trying to evaluate the arguments in the
Iifregardless of whether the condition is true or not. Try:Of course this assumes that if
txtTotalFixedAsset3is 0 thentxtTotalFixedAssetis 0 as well. If not then it truly is a divide by 0 error.