How do list results of a column in a table in one field separated by commas in MS Access

imodett 61 Reputation points
2024-10-16T18:48:02.2+00:00

I would like to know how to get a column into a query field. Similar to how in Access if you use the multi-value field in MS Access. However, i do not wish to use the mutli-value.

For example, if I had a table

column1 with
A
C
D
F
G

(one letter in each row under Colmn1).

and I wanted to display it in a query field like: A, C, D, F, G

How could i achieve this?

Access
Access
A family of Microsoft relational database management systems designed for ease of use.
420 questions
Access Development
Access Development
Access: A family of Microsoft relational database management systems designed for ease of use.Development: The process of researching, productizing, and refining new or existing technologies.
893 questions
Office Management
Office Management
Office: A suite of Microsoft productivity software that supports common business tasks, including word processing, email, presentations, and data management and analysis.Management: The act or process of organizing, handling, directing or controlling something.
2,214 questions
0 comments No comments
{count} votes

Accepted answer
  1. Karl Donaubauer 2,056 Reputation points MVP
    2024-10-16T20:24:14.0433333+00:00

    Hi,

    Allen Browne has a ready made function to do it:

    http://www.allenbrowne.com/func-concat.html

    Servus
    Karl


    Access Forever, News, DevCon
    Access-Entwickler-Konferenz AEK - 19./20.10. Nürnberg

    0 comments No comments

2 additional answers

Sort by: Most helpful
  1. Ken Sheridan 2,846 Reputation points
    2024-10-21T13:12:00.8133333+00:00

    You might also like to take a look at Concat.zip in my public databasse folder at:

    https://onedrive.live.com/?id=44CC60D7FEA42912%21169&cid=44CC60D7FEA42912

    This includes an illustration of the use of a GetList function which calls the highly efficient GetString method of the ADO Recordset object to concatenate values in a column into a single delimited string expression. The illustration of the function in the demo uses a column from a related table to return a subset of values from the column, but you can use it on a single table simply by omitting the final optional strFilter argument when calling the function.


  2. imodett 61 Reputation points
    2024-10-31T11:30:38.64+00:00

    Thanks to the both of you for providing a response, I believe this is what I've seen before. I just lost the notes on it. Once again, thanks.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.