Results 1 to 9 of 9
  1. #1
    Lounger
    Join Date
    Nov 2003
    Location
    St. Paul, Minnesota, USA
    Posts
    29
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Two line text box (2003)

    I know this is a simple problem, but I can't seem to pick the right words for the search engine to find my answer.

    I want to create a text box in a report that shows:

    Name
    Address
    City, State Zip

    I can get the information I want on one line, but I cannot figure out how to put in a carriage return to combine them into one box (I've tried ALT+Enter, etc.). Here is what I have:

    =[Salutation] & " " & [FirstName] & " " & [LastName] (First box)
    =[Address1] (second box)
    =[Address2] (third box)
    =[City] & ", " & [State] & " " & [Zip]

    I know that I will be using a + to connect them in case the field is blank. Can one of you wise and talented Access gurus point me in the right direction?

    Thank you!

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

    Re: Two line text box (2003)

    You can create line breaks by concatenating with Chr(13) & Chr(10), i.e. carriage return + line feed. In your situation:

    =[Salutation] & " " & [FirstName] & " " & [LastName] & Chr(13) & Chr(10) & [Address1] & Chr(13) & Chr(10) & [Address2] & Chr(13) & Chr(10) & [City] & ", " & [State] & " " & [Zip]

    or

    =[Salutation] & " " & [FirstName] & " " & [LastName] & (Chr(13)+Chr(10)+[Address1]) & (Chr(13)+Chr(10)+[Address2]) & (Chr(13)+Chr(10)+[City]+", "+[State]+" "+[Zip])

  3. #3
    Lounger
    Join Date
    Nov 2003
    Location
    St. Paul, Minnesota, USA
    Posts
    29
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Two line text box (2003)

    Dank u. <img src=/S/thankyou.gif border=0 alt=thankyou width=40 height=15>

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

    Re: Two line text box (2003)

    Graag gedaan!

  5. #5
    2 Star Lounger
    Join Date
    Oct 2006
    Location
    Melbourne, Victoria, Australia
    Posts
    129
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hi Hans,

    I'm trying to do the same thing, except i need to combine 8 separted check boxes into one text box (with carriage returns). My problem is that i don't want the blank spaces in between items in the text box if the corresponding check box is not selected.

    for example, i want to avoid this:

    pain

    sob
    wheeze

    haemoptysis


    Any suggestions?
    Regards,
    Van

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    In an expression such as

    =[Salutation] & " " & [FirstName] & " " & [LastName] & (Chr(13)+Chr(10)+[Address1]) & (Chr(13)+Chr(10)+[Address2])

    the use of + instead of & means that the part (Chr(13)+Chr(10)+[Address1]) will be Null if Address1 is Null, i.e. the carriage return/linefeed will be suppressed if Address1 is blank.

  7. #7
    2 Star Lounger
    Join Date
    Oct 2006
    Location
    Melbourne, Victoria, Australia
    Posts
    129
    Thanks
    0
    Thanked 0 Times in 0 Posts
    [quote name='HansV' post='761082' date='24-Feb-09 20:25']In an expression such as

    =[Salutation] & " " & [FirstName] & " " & [LastName] & (Chr(13)+Chr(10)+[Address1]) & (Chr(13)+Chr(10)+[Address2])

    the use of + instead of & means that the part (Chr(13)+Chr(10)+[Address1]) will be Null if Address1 is Null, i.e. the carriage return/linefeed will be suppressed if Address1 is blank.[/quote]

  8. #8
    2 Star Lounger
    Join Date
    Oct 2006
    Location
    Melbourne, Victoria, Australia
    Posts
    129
    Thanks
    0
    Thanked 0 Times in 0 Posts
    thank you Hans. works great.

    (ps. having a bit of trouble working out how to send reply in the new Loung layout)

  9. #9
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    If you click the " Reply button at the bottom of a post, you'll get a box that includes the post you're replying to as a quote. You can keep the quote, edit it or throw it away, and of course add your own text.

    If you click the Add Reply button at the very bottom of the thread, you'll get a blank reply box.

Posting Permissions

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