Results 1 to 8 of 8
  1. #1
    Join Date
    Jul 2003
    Location
    Canberra, ACT Australia
    Posts
    53

    Unanswered: concatenate fields and lines

    I ahve a number of address type fields that I wish to place on a form. I can join them using eg fiild1 & field2 & field3, howeveer I'd like to join the fields along with a linefeed/carriage return inthe concatenation.

    In the control box, when typing the source in I can get a new line, however I want this to show on the report.

    Basically I am joing perhaps 4 fields in one line with 3 fields in another 2 lines, and I want it to be in one control area as 3 lines with the fields all joined.

    Cheers

  2. #2
    Join Date
    Apr 2004
    Location
    Sydney Australia
    Posts
    369
    Is this what you are trying to do.

    Name...............Street..................... Suburb

    John Smith........15 Grove Street.........Hurstville NSW 2209

    Becomes

    John Smith Grove Street Hurstville NSW 2209

    and displays in a single field as

    John Smith
    Grove Street
    Hurstville NSW 2209

    Mike

  3. #3
    Join Date
    Jul 2003
    Location
    Canberra, ACT Australia
    Posts
    53
    yes. And prints on the report

  4. #4
    Join Date
    Sep 2003
    Location
    The extremely Royal borough of Kensington, London
    Posts
    778
    This is to be done by the application.

    For each row in rowCollection
    str += col(0) + col(1) + col(2)
    Next
    Bessie Braddock: Winston, you are drunk!
    Churchill: And Madam, you are ugly. And tomorrow, I'll be sober, and you will still be ugly.

  5. #5
    Join Date
    Apr 2004
    Location
    Sydney Australia
    Posts
    369
    There are two ways I can think of to do that, one easy and one harder. Actually, I do a very similar thing with file notes that are made and this is done the hard way.

    If you join the the 3 fields as in

    John Smith Grove Street Hurstville NSW 2209

    and then have it in either a text or memo field with the property Enter Key Behaviour as New Line in Field you will run into the problem of varying lenghths. In other words, what will be the right width for

    John Smith Grove Street Hurstville NSW 2209 so as to get the three separate lines will be wrong for

    William McDowell Harbour View Avenue Forest Lodge NSW 2209

    The easy way is to set up your report so that the 3 fields more or less merge or touch each other and then make the borders of the field boxes transparent. If you wanted a border around the 3 fields you could then use the rectangle from "tools in form design" and surround the 3 fields.

    The harder way, which I don't think you will need, is whay I do for file notes.

    Each file note is a separate record but I want them to display as if they were all entered down a page and with each noted preceded by the time and date. I do that with a large macro that mixes up copy and paste with key stroke actions. I don't think you will need to do this and for two reasons:

    1) You will always have three lines where as I could have 3 file notes or 33 file notes

    2) I need to be able to put mine in Word.

    The hard way is basically automating copying and pasting one field into a memo field and then copying and pasting the next field on the next line and so on.

    But I think for your requirments physically blending the fields might be the way to go and thus don't even both joing then with & " " &

    Mike

  6. #6
    Join Date
    Sep 2002
    Location
    Finland
    Posts
    34
    If you want several fields in one control simple way is

    & Chr(13) & Chr(10) &

    or

    & "
    " & (use enter between "")

    Example:
    =[Field1] & Chr(13) & Chr(10) & [Field2] & " " & [Field3] & " " & [Field4] & "
    " & [Field5] & "
    " & [Field6]

  7. #7
    Join Date
    Jul 2003
    Location
    Canberra, ACT Australia
    Posts
    53
    cheers. Will apply to my work. Many thanks.

  8. #8
    Join Date
    Jul 2003
    Location
    Canberra, ACT Australia
    Posts
    53
    mns
    many thanks. I stuck with the chr(13) and chr(10) as I was more familiar/comfortable with that method. Worked a treat. Once again many thanks

Posting Permissions

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