Results 1 to 8 of 8
  1. #1
    PaulGoer is offline Novice
    Windows 10 Access 2016
    Join Date
    Aug 2018
    Posts
    2

    concatenate rows into one

    Hi All - first time posting.
    I apologize if this is here somewhere - I have searched and cannot seem to find it.

    I have a table named "Problems" in Access 2016 that has two columns: County, Issue

    Here is sample data:
    County Issue
    Conner Parks
    Conner Roads
    Conner Utilities
    Conner Water
    Folk Parks
    Preston Parks
    Preston Water

    I want to run a query that will take the issues for each county and place them in a field, like this:
    County Issues
    Conner Parks, Roads, Utilities, Water
    Folk Parks
    Preston Parks, Water



    Even better would be if carriage returns are possible:
    County Issues
    Conner Parks
    Roads
    Utilities
    Water
    Folk Parks
    Preston Parks
    Water

    I am stumped. If anyone has done this and can share any ideas, it would be greatly appreciated.

    THANKS
    Paul

  2. #2
    ssanfu is offline Master of Nothing
    Windows 7 32bit Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    Maybe this by Allen Browne?
    Concatenate values from related records

    For the second example, you would/could use a temp table and base a report off of the records.

  3. #3
    PaulGoer is offline Novice
    Windows 10 Access 2016
    Join Date
    Aug 2018
    Posts
    2
    I have been unable to make Allen's function work. I think I simply don't know the proper form for the query.
    As for a report, that will not work because I need to export the results as a file (Excel or RTF) so that I can do a mail merge to send email with the results.


    Quote Originally Posted by ssanfu View Post
    Maybe this by Allen Browne?
    Concatenate values from related records

    For the second example, you would/could use a temp table and base a report off of the records.

  4. #4
    ssanfu is offline Master of Nothing
    Windows 7 32bit Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    Well, another option is you could "brute force" the export of the data to WORD using VBA, depending your coding skills.

    Here is one example MS Access – VBA – Export Records to MS Word
    Obviously you would have to modify the code.... but if you have the Access record set already developed, it shouldn't be that difficult. (but I have never done this with Word).




    BTW, I searched on "export access records to word" (no quotes).

  5. #5
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows 7 32bit Access 2016
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,544
    Quote Originally Posted by PaulGoer View Post
    I have been unable to make Allen's function work. I think I simply don't know the proper form for the query.
    As for a report, that will not work because I need to export the results as a file (Excel or RTF) so that I can do a mail merge to send email with the results.
    Can you post a copy of your db.
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  6. #6
    Carouser is offline Advanced Beginner
    Windows 10 Access 2010 32bit
    Join Date
    Jul 2012
    Location
    Melbourne, Australia
    Posts
    56
    Use Access Reports to display your data with the format you require from your query. Easily export as a PDF or print

  7. #7
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    If you want each issue on a line, how is this different from a normal report design? Use textbox HideDuplicates property for the county.

    Access can email the report as a PDF attachment. Or build a text string and embed in email body. Even use HTML tags to build a table in the body.

    Unless you need a lot of formatted text from a Word document suggest avoiding mail merge.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  8. #8
    Minty is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2017
    Location
    UK - Wiltshire
    Posts
    3,003
    DLookup Syntax and others http://access.mvps.org/access/general/gen0018.htm
    Please use the star below the post to say thanks if we have helped !
    ↓↓ It's down here ↓↓

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Concatenate Rows into one row
    By rkalapura in forum Programming
    Replies: 4
    Last Post: 04-23-2015, 06:52 PM
  2. Concatenate 3 rows into single header row
    By kestefon in forum Access
    Replies: 13
    Last Post: 01-31-2014, 06:10 PM
  3. merge or concatenate two rows in one
    By vojinb in forum Queries
    Replies: 7
    Last Post: 08-03-2011, 09:15 AM
  4. Help needed - Trying to concatenate rows
    By clarkian11 in forum Queries
    Replies: 15
    Last Post: 06-09-2011, 10:11 AM
  5. Concatenate Multiple Rows into One
    By Knarly555 in forum Queries
    Replies: 5
    Last Post: 11-12-2010, 06:51 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums