Results 1 to 5 of 5
  1. #1
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    San Francisco, California, USA
    Posts
    358
    Thanks
    0
    Thanked 0 Times in 0 Posts

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

    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 :-)

  2. #2
    Lounger
    Join Date
    Nov 2001
    Posts
    38
    Thanks
    0
    Thanked 0 Times in 0 Posts

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

    & Chr(13) & Chr(10) &

  3. #3
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    San Francisco, California, USA
    Posts
    358
    Thanks
    0
    Thanked 0 Times in 0 Posts

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

    Ah Yes! I knew there had to be....

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

    Thanks! :-)

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

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

    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.

  5. #5
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    San Francisco, California, USA
    Posts
    358
    Thanks
    0
    Thanked 0 Times in 0 Posts

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

    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 :-)

Posting Permissions

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