• Adding spaces (XP & 2000)

    Author
    Topic
    #382075

    In a report, I’m using an unbound text box to display the values from three fields in a table. Each value is a single-digit. In most cases, the text box will display just one digit, but some will display two or even three digits. In those cases where I need to display two or three digits, I need some space between them.

    What I have now is the following expression for this text box:

    =[Criterion1] & “” & [Criterion2] & “” & [Criterion3]

    Those double quotation marks are supposed to add space, just as if I were concatenating the parts of a person’s name, right? Trouble is, I don’t see the space–at least, not ENOUGH space. I do not want the result to appear as if it were a three digit number. I want the text box to display two or three digits as distinctly separate. How can I get the space I need?

    Viewing 1 reply thread
    Author
    Replies
    • #646513

      The double quotes don’t add anything except a zero-length string. If you want spaces, you’ll have to add them between the quotes like this:

      =[Criterion1] & " " & [Criterion2] & " " & [Criterion3]
    • #646527

      If you had Criterion1 and Criterion3 but no Criterion2 you would get a double space between the digits (after you correct as Charlotte says).

      The following is one way around this.
      =[Criterion1] & ” ” & [Criterion2] & iif(not isnull([Criterion2]; ” “) & [Criterion3]

      • #646559

        Thanks, Andy!

        I neglected to mention a few details. In this report, there will never be anything in Criterion3 if Criterion2 is null. Nonetheless, the information you gave me will no doubt be useful in other situations.

    Viewing 1 reply thread
    Reply To: Adding spaces (XP & 2000)

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

    Your information: