Results 1 to 9 of 9
  1. #1
    2 Star Lounger
    Join Date
    Oct 2004
    Location
    Minnesota, USA
    Posts
    151
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Concantenate Text in Report Control (Office 2003)

    I have a report control where I want to concantenate four text fields into one. I can get that to work; however, I would like to insert a carriage return between the blocks of text. When I use what's shown before as the data source for the field, I get all the comment fields, but they run together. I would like to put a carriage return, a small identifier lable, and another carriage return. For example, between [Comments] and [CommentsShare], I would insert a label that says "Shared Comments" with a carriage return before and after. I know how to do the label part; it's the carriage return that has me stumped.

    =[COMMENTS] & " " & [CommentsShare] & " " & [CommentsMgmt] & " " & [CommentsConfid]

    Thanks for any suggestions you may have.

  2. #2
    Super Moderator WebGenii's Avatar
    Join Date
    Jan 2001
    Location
    Redcliff, Alberta, Canada
    Posts
    4,066
    Thanks
    2
    Thanked 5 Times in 5 Posts

    Re: Concantenate Text in Report Control (Office 2003)

    try: VbCrlf
    for the carriage return
    [b]Catharine Richardson (WebGenii)
    WebGenii Home Page
    Moderator: Spreadsheets, Other MS Apps, Presentation Apps, Visual Basic for Apps, Windows Mobile

  3. #3
    2 Star Lounger
    Join Date
    Oct 2004
    Location
    Minnesota, USA
    Posts
    151
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Concantenate Text in Report Control (Office 2003)

    Thanks, Catherine. I tried it, and when I put it in and tried to preview the report, I got an "Enter Parameter Value" dialog for VbCrlf.

  4. #4
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Sint Niklaas, Belgium
    Posts
    2,778
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Concantenate Text in Report Control (Office 2003)

    Did you try vbCrLf with an L and not an uppercase i ?
    Francois

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

    Re: Concantenate Text in Report Control (Office 2003)

    vbCrLf can only be used in VBA, not in expressions. Instead, use Chr(13) & Chr(10):

    =[COMMENTS] & Chr(13) & Chr(10) & [CommentsShare] & " " & [CommentsMgmt] & " " & [CommentsConfid]

  6. #6
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Sint Niklaas, Belgium
    Posts
    2,778
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Concantenate Text in Report Control (Office 2003)

    Oops, missed this one <img src=/S/blush.gif border=0 alt=blush width=15 height=15>
    Francois

  7. #7
    2 Star Lounger
    Join Date
    Oct 2004
    Location
    Minnesota, USA
    Posts
    151
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Concantenate Text in Report Control (Office 2003)

    I thought vbCrLf was limited to VBA, but tried it anyway.

    I had tried Chr(13) and Chr(10) by themselves. Didn't realize I needed both of them. Works perfectly. Thank you!

  8. #8
    Super Moderator WebGenii's Avatar
    Join Date
    Jan 2001
    Location
    Redcliff, Alberta, Canada
    Posts
    4,066
    Thanks
    2
    Thanked 5 Times in 5 Posts

    Re: Concantenate Text in Report Control (Office 2003)

    Thanks for correcting Me!
    [b]Catharine Richardson (WebGenii)
    WebGenii Home Page
    Moderator: Spreadsheets, Other MS Apps, Presentation Apps, Visual Basic for Apps, Windows Mobile

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

    Re: Concantenate Text in Report Control (Office 2003)

    Francois and Catharine,

    I have fallen into the same trap more often than I would like to admit... <img src=/S/grin.gif border=0 alt=grin width=15 height=15>

Posting Permissions

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