Results 1 to 7 of 7
  1. #1
    orangeman2003 is offline Novice
    Windows 8 Access 2010 32bit
    Join Date
    Nov 2013
    Posts
    21

    Stuck on Access concatenating into string

    So I'm having a hell of a time here with this issue. I've gone to Allen Browne's page and tried to use his SQL function but it did not work. Basically I have a mapping of a file name to the columns in that file. I have about 30 files and while most have 5-10 headings, one of the files has 40. Because of this I want to display the values in sequential format with a comma separator rather than rows, such as (column1, column2, column3, etc.) I want to do this because my report looks dumb having a record with 40 rows with one word each. How can I do this in access 2007?



    I do not want to combine every result into one record rather where a value is >1 (in my case more than one column in a file) I want that listed sequentially instead of rows.

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,926
    Don't know what SQL function you are referring to but have you looked at Allen Browne's ConcatRelated code? http://allenbrowne.com/func-concat.html

    Or you can try a multi-column report. Set this with Page Setup dialog.
    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.

  3. #3
    orangeman2003 is offline Novice
    Windows 8 Access 2010 32bit
    Join Date
    Nov 2013
    Posts
    21
    Hi,

    I have attached a screen shot to give you a better understanding of what I'm trying to do. This is a screen shot from a report where for this record, there are a ton of values for the 'SAN' record. What I want to do is take all of those values and format them so they appear one after the other separated by a comma instead of using 1 row for each record. It would go (COSTCENTER, BUSINESSUNIT, HOSTNAME, MONTHLYCOST2)......Click image for larger version. 

Name:	concatenatingtextasstring.png 
Views:	15 
Size:	179.7 KB 
ID:	14856

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,926
    One of the suggestions offered should accomplish that.
    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.

  5. #5
    orangeman2003 is offline Novice
    Windows 8 Access 2010 32bit
    Join Date
    Nov 2013
    Posts
    21
    Quote Originally Posted by June7 View Post
    One of the suggestions offered should accomplish that.
    Trust me, I spent hours yesterday on the Allen Browne site, just cant get either the VBA or the SQL to do what I want.

  6. #6
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,926
    How have you attempted to use Allen Browne code? What exactly happens when you attempt? Error message, wrong results, nothing? We need something to analyze. Of course, it is possible the resulting concatenated list string could be too long for Access limitations but that is unlikely.

    It also appears that multi-column report would be suitable.
    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.

  7. #7
    amrut is offline Expert
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jun 2012
    Location
    Dubai
    Posts
    614
    June7 is already helping you out. I just want to add my bit. The ConcatRelated function by AllenBrowne is to combine multiple records from a single field.
    Are you sure the data you wish to concatenate has records in a single field ?

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

Similar Threads

  1. Replies: 11
    Last Post: 09-04-2012, 01:17 AM
  2. Replies: 4
    Last Post: 03-08-2012, 03:29 PM
  3. Replies: 0
    Last Post: 03-05-2012, 01:07 PM
  4. Access Question I am stuck on
    By sai_rlaf in forum Access
    Replies: 31
    Last Post: 01-25-2011, 04:24 PM
  5. Sigh, having used Access in 5 years and stuck..
    By Access Denied in forum Access
    Replies: 3
    Last Post: 10-06-2009, 02:19 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