• Return choice if true (2003)

    Author
    Topic
    #443207

    Hi, it’s me again,

    I have an unbound text box on a report which reads: =IIf([textbook]=No,””,”Textbook”)+” “+IIf([classnotes]=No,””,”Notes”)+” “+IIf([calculator]=No,””,”Calculator”)+” “+IIf(IsNull([Other]),””,[Other])+” “+IIf([notecard]=No,””,”3×5 card”)

    Basically, if these checkboxes are checked, then put the name on the report. My problem is that they run together now with only a space between. I’d like to get them to line up with one line in between. I tried CHR(13) & CHR(10), but that gives me double spacing and blank lines if the answer is false. Is there a function to check if these items are true and return the name if they are? I don’t think Switch or Choose will work because that only returns the first true and there may be more than one true statement in this list.

    Thanks!

    Jodi

    Viewing 0 reply threads
    Author
    Replies
    • #1068585

      Try

      =IIf([Textbook]=No,Null,”TextBook”) & (Chr(13)+Chr(10)+IIf([ClassNotes]=No,Null,”Notes”)) & (Chr(13)+Chr(10)+IIf([Calculator]=No,Null,”Calculator”)) & (Chr(13)+Chr(10)+IIf([Other]=No,Null,”Other”) & (Chr(13)+Chr(10)+IIf([NoteCard]=No,Null,”3×5 card”))

      Note the use of Null instead of “”.

      • #1068598

        (Edited by HansV to make URL clickable – see Help 19)

        It worked when I changed it to this:

        =IIf([Textbook]=No,Null,”TextBook”) & IIf([ClassNotes]=No,Null,”Notes” & Chr(13)+Chr(10)) & IIf([Calculator]=No,Null,”Calculator” & Chr(13)+Chr(10)) & IIf([NoteCard]=No,Null,”3×5 card” & Chr(13)+Chr(10)) & IIf(IsNull([Other]),Null,[Other] & Chr(13)+Chr(10))

        I moved the Chr(13)+Chr(10) to the end right behind the falsepart so that it only adds the line if the statement is false. I got this idea from another message you posted which linked to an article at http://support.microsoft.com/?kbid=287685%5B/url%5D.

        Thanks for solving another problem! You rock!

        Jodi

    Viewing 0 reply threads
    Reply To: Return choice if true (2003)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: