Results 1 to 3 of 3
  1. #1
    Lounger
    Join Date
    Jun 2002
    Location
    Michigan City, Indiana, USA
    Posts
    37
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Return choice if true (2003)

    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,"","3x5 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

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Return choice if true (2003)

    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,"3x5 card"))

    Note the use of Null instead of "".

  3. #3
    Lounger
    Join Date
    Jun 2002
    Location
    Michigan City, Indiana, USA
    Posts
    37
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Return choice if true (2003)

    (Edited by HansV to make URL clickable - see <!help=19>Help 19<!/help>)

    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,"3x5 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.

    Thanks for solving another problem! You rock!

    Jodi

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •