Welcome to SPN

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

Sign Up Now!

Combining results of IIf statements

Discussion in 'Information Technology' started by APCinFla, Jul 28, 2006.

  1. APCinFla

    APCinFla
    Expand Collapse
    Guest

    Is there a way to possibly combine the results of IIf statements, seperating
    the results of the statements by commas in one text box. Basically I have
    eight IIf statements that I am running and I am trying to get the results
    listed together in one text box.

    Example: Result 1, Result 2, Result 3, Result 4, Result 5, Result 6, Result
    7, Result 8.

    I was able to get this to work only if all 8 IIf statements were true for
    the record I am working on. If the record has at least one false IIf
    statement then the entire box comes back with only a -1 in it. If the IIf
    statement produces a false value I just want it to go on to the next
    statement and just list all the results that are true.

    Is this possible? Should I be using something besides IIf statements?

    Thanks.
     
  2. Loading...


  3. Sprinks

    Sprinks
    Expand Collapse
    Guest

    You can concatenate your results using the & operator, for example:

    =IIf("x"="x","T","F") & "," & IIf("x"="y","T","F") will display:

    T,F

    Hope that helps.
    Sprinks

    "APCinFla" wrote:

    > Is there a way to possibly combine the results of IIf statements, seperating
    > the results of the statements by commas in one text box. Basically I have
    > eight IIf statements that I am running and I am trying to get the results
    > listed together in one text box.
    >
    > Example: Result 1, Result 2, Result 3, Result 4, Result 5, Result 6, Result
    > 7, Result 8.
    >
    > I was able to get this to work only if all 8 IIf statements were true for
    > the record I am working on. If the record has at least one false IIf
    > statement then the entire box comes back with only a -1 in it. If the IIf
    > statement produces a false value I just want it to go on to the next
    > statement and just list all the results that are true.
    >
    > Is this possible? Should I be using something besides IIf statements?
    >
    > Thanks.
    >
     
  4. BruceM

    BruceM
    Expand Collapse
    Guest

    If you still need help with this after trying the other suggestion, it would
    help if you post some version of the IIf statement. You don't need all
    eight results to illustrate your point; three or four should be plenty.

    "APCinFla" <APCinFla@discussions.microsoft.com> wrote in message
    news:B8F75CAB-843A-4F8A-97B1-1E4A48625CE3@microsoft.com...
    > Is there a way to possibly combine the results of IIf statements,
    > seperating
    > the results of the statements by commas in one text box. Basically I have
    > eight IIf statements that I am running and I am trying to get the results
    > listed together in one text box.
    >
    > Example: Result 1, Result 2, Result 3, Result 4, Result 5, Result 6,
    > Result
    > 7, Result 8.
    >
    > I was able to get this to work only if all 8 IIf statements were true for
    > the record I am working on. If the record has at least one false IIf
    > statement then the entire box comes back with only a -1 in it. If the IIf
    > statement produces a false value I just want it to go on to the next
    > statement and just list all the results that are true.
    >
    > Is this possible? Should I be using something besides IIf statements?
    >
    > Thanks.
    >
     
  5. APCinFla

    APCinFla
    Expand Collapse
    Guest

    Thanks, it worked. I was using the "+" sign instead of the "&". Thanks again!

    "Sprinks" wrote:

    > You can concatenate your results using the & operator, for example:
    >
    > =IIf("x"="x","T","F") & "," & IIf("x"="y","T","F") will display:
    >
    > T,F
    >
    > Hope that helps.
    > Sprinks
    >
    > "APCinFla" wrote:
    >
    > > Is there a way to possibly combine the results of IIf statements, seperating
    > > the results of the statements by commas in one text box. Basically I have
    > > eight IIf statements that I am running and I am trying to get the results
    > > listed together in one text box.
    > >
    > > Example: Result 1, Result 2, Result 3, Result 4, Result 5, Result 6, Result
    > > 7, Result 8.
    > >
    > > I was able to get this to work only if all 8 IIf statements were true for
    > > the record I am working on. If the record has at least one false IIf
    > > statement then the entire box comes back with only a -1 in it. If the IIf
    > > statement produces a false value I just want it to go on to the next
    > > statement and just list all the results that are true.
    > >
    > > Is this possible? Should I be using something besides IIf statements?
    > >
    > > Thanks.
    > >
     

Share This Page