none
#Num! Error RRS feed

  • Question

  • I have the following code =[OfficeAllow]/([InsAllow]+[ShopAllow]+[OfficeAllow]) as the control source for a text box. It works perfect if all boxes have a value but if there is no value I get the #Num! Error. What can I do to get a zero value instead.

    Thanks

    Friday, September 13, 2019 5:18 PM

All replies

  • If all those fields are number fields you can use this.

    =IIf((Nz([InsAllow],0)+Nz([ShopAllow],0)+Nz([OfficeAllow],0))=0,0,Nz([OfficeAllow],0)/([InsAllow]+[ShopAllow]+[OfficeAllow]))


    If this post answered or helped you find the answer to your question, please mark it as such for other Forum users knowledge.



    • Edited by DriveEV Friday, September 13, 2019 5:51 PM
    Friday, September 13, 2019 5:49 PM