Full Version: Iif Statement On Form
UtterAccess Forums > Microsoft® Access > Access Forms
tenthmtn
Ok, I give up lol!! I have been trying to figure out how to format an IIF Statement to set a value to Yes if greater than 45 or to No if not greater than 45. The IIF statement is evaluating a textbox on a form and setting the Yes, or No field in another field on the form.
This is what I had so far Me.Timely= IIF(([text43]>45,"Yes","No") I also need for this to evaluate to "N/A" for null values in the textbox, I imagine some type of NZ added in here somewhere. Anyway thanks for any help!!
rbianco
see if this helps:
iif(IsNull([text43]),"n/a",IIF([text43]>45,"Yes","No"))
tenthmtn
Thanks rbianco I appreciate your help but I am receiving an error. I tried it exactly as you sent it as well as trying Me.Timely = IIF(IsNull([text43]),"n/a",IIF([text43]>45,"Yes","No"))
rbianco
what exactly is the error? iif(IsNull([text43]),"n/a",IIF([text43]>45,"Yes","No")) is correct syntax provided that [text43] is a number, AND provided that Me.Timely is permitted to be a String.
tenthmtn
rbianco you were right, my bad!!! I had an issue with the after update trigger, it is working perfectly now. Thanks so much for your help!!!!!
rbianco
glad you got it goin'. (those nested iif's can be quite a pain sometime!)
This is a "lo-fi" version of UA. To view the full version with more information, formatting and images, please click here.