• Multi-line textbox on report (Access 97, Win 95/98)

    Home » Forums » AskWoody support » Productivity software by function » MS Access and database help » Multi-line textbox on report (Access 97, Win 95/98)

    Author
    Topic
    #374464

    Why do I get these always on Fridays 😉

    Does anyone know if there is a character code that I can use in a textbox on a report?

    I have a textbox that contains two pieces of information, UserName & Project. What I’d like to do is have hte equivalent of =UserName & vbCrLf & Project in a textbox, but the report doesn’t like vbCrLf. I’d like to have both pieces of information in the same textbox so that can shrink will work properly for the section, and the two pieces of information will display on two separate lines where there are two pieces of information. Is there a chr code or other some such to do this?

    TIA!

    Cecilia 🙂

    Viewing 0 reply threads
    Author
    Replies
    • #605742

      & Chr(13) & Chr(10) &

      • #605744

        Ah Yes! I knew there had to be….

        Funny thing is it matters what order you put the two in. Strange.

        Thanks! 🙂

        • #606027

          It’s an old convention that you move to a new line by Carriage Return (CR) = Chr(13) followed by Line Feed (LF) = Chr(10).

          You can also create a custom function in a standard module:

          Function CrLf() As String
          CrLf = vbCrLf
          End Function

          and use this in expressions:

          =[UserName] & CrLf() & [Project]

          Overkill if you use it once or twice, but handy if you use it a lot.

          • #606529

            Cool. Actually, this is the first time that it’s come up. I guess I usually just try to do stuff to avoid it, but this time I couldn’t get around it (gracefully).

            Thanks to all!

            Cecilia 🙂

    Viewing 0 reply threads
    Reply To: Multi-line textbox on report (Access 97, Win 95/98)

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

    Your information: