Welcome to SPN

Register and Join the most happening forum of Sikh community & intellectuals from around the world.

Sign Up Now!

Question About IIF Statement

Discussion in 'Information Technology' started by JOM, Oct 28, 2005.

  1. JOM

    JOM
    Expand Collapse
    Guest

    I have a 2 fields in my table/Form field XYZ and ABC
    if XYz is true then ABC needs to be true
    if XYZ is true and ABC is missing, then ABC will have a "missing" value

    I have the following statement as a control source for my text box on my
    form but its giving me an error.
    =IIf(IsNull([ABC] & [XYZ])=True,"Missing",[ABC])
     
  2. Loading...

    Similar Threads Forum Date
    Anyone Have Any Unanswered Questions On Sikhi Or God? Sikh Sikhi Sikhism Jan 7, 2017
    Question About Translations Questions and Answers Dec 20, 2016
    Question About GGS Questions and Answers Aug 28, 2016
    Marriage And Discrimination Related Questions Blogs Mar 21, 2016
    Sikhi Questioning Faith Sikh Sikhi Sikhism Mar 3, 2016

  3. OP
    Ofer

    Ofer
    Expand Collapse
    Guest

    Try this

    IIf([ABC] Is Null And [XYZ] Is Null,"Missing",[ABC])

    But from your explenation I can't fully understand what you need
    if XYz is true then ABC needs to be true
    if XYZ is true and ABC is missing, then ABC will have a "missing" value
    (but the first condition been applied, so there is no need for this
    condition, XYZ is true, Now what if it False?)

    --
    If I answered your question, please mark it as an answer. That way, it will
    stay saved for a longer time, so other can benifit from it.

    Good luck



    "JOM" wrote:

    > I have a 2 fields in my table/Form field XYZ and ABC
    > if XYz is true then ABC needs to be true
    > if XYZ is true and ABC is missing, then ABC will have a "missing" value
    >
    > I have the following statement as a control source for my text box on my
    > form but its giving me an error.
    > =IIf(IsNull([ABC] & [XYZ])=True,"Missing",[ABC])
    >
    >
     
  4. OP
    Douglas J Steele

    Douglas J Steele
    Expand Collapse
    Guest

    Part of your problem is that you're referring to ABC in the IIf statement
    that's setting ABC's value. As well, if you're expecting ABC to be a boolean
    value (True/False), it can't have a value of Missing.

    What happens if XYZ is False? The following assumes ABC will be set to the
    word False.

    IIf(IsNull([ABC]) AND [XYZ],"Missing", Format([XYZ],"True/False"))


    --
    Doug Steele, Microsoft Access MVP
    http://I.Am/DougSteele
    (no e-mails, please!)


    "JOM" <JOM@discussions.microsoft.com> wrote in message
    news:9C3DA1DE-A7D9-407D-957A-4EA85AD7DF44@microsoft.com...
    > I have a 2 fields in my table/Form field XYZ and ABC
    > if XYz is true then ABC needs to be true
    > if XYZ is true and ABC is missing, then ABC will have a "missing" value
    >
    > I have the following statement as a control source for my text box on my
    > form but its giving me an error.
    > =IIf(IsNull([ABC] & [XYZ])=True,"Missing",[ABC])
    >
    >
     
Since you're here... we have a small favor to ask...     Become a Supporter      ::     Make a Contribution     


Share This Page