How to Return Multiple Child Values for Each Parent in Microsoft Access
Question details
The user needs to display multiple associated child records grouped alongside their corresponding parent name.

- Product
- Microsoft Access
- Device & OS
- not provided
- Scenario
- Structuring query results or reports to properly group and display one-to-many relationship data.
- Observed behavior
- Instead of returning standard multiple rows for each child item, the goal is to show child values as a comma-separated list, in distinct columns, or in a structured report layout beside the parent.
Ensure your Microsoft Access database file is placed in a Trusted Location and choose to 'Enable Content' if prompted by security warnings, as custom VBA functions require macros to run properly.
Concatenate Child Values Using a Custom VBA Function
Create a comma-separated string of child values for each parent record to display cleanly in a single query column.
Microsoft Access does not have a native string aggregation function like other SQL databases. You will need to implement a user-defined VBA function to concatenate the child records.
Press ALT + F11 to open the Visual Basic for Applications (VBA) editor and insert a new module from the top menu.
Paste a standard concatenation function script (such as ConcatRelated) into the module and save it.
Open your query in Design View and create a new expression in the Field row calling your custom function, passing the parent ID to group the child records.

Use an Access Report with a Subreport
Display child values in an across-then-down column layout beside each parent name without writing code.
Create a Crosstab Query
Pivot your dataset to transform child rows into distinct column headers for each year or category.
Looking for a Lightweight and Free Office Suite? Try WPS Office
While Microsoft Access handles highly complex relational databases, your daily document drafting, spreadsheet management, and presentation needs can be met effortlessly with WPS Office. It provides an intuitive interface, broad compatibility, and runs smoothly on all major operating systems.
- 1. Download the Installer: Visit the official WPS Office website and download the free installation file for your operating system.
- 2. Install WPS Office: Run the downloaded file and follow the on-screen prompts to install the suite on your device.
- 3. Open and Create: Launch WPS Office to start opening, creating, or editing your documents, spreadsheets, and presentations immediately.

Frequently Asked Questions
Why does my Access crosstab query show IDs instead of the actual child values?
This happens if the 'Value' field in your crosstab query is configured to pull the ID column rather than the descriptive data field. To fix this, change the designated Value field in the query design grid to the specific child data you wish to display, such as the year.
Can I display child values as a comma-separated list without using VBA?
Natively, Access queries do not support grouping rows into a comma-separated string without a custom VBA function. You will need to implement a user-defined script to iterate through the child records and combine them.
Why is my database displaying a warning about malicious code?
Microsoft Access restricts the execution of macros and VBA code by default for security purposes. If you know the source of the database is safe, you must select the option to 'Enable Content' on the yellow warning bar or move the file to a designated Trusted Location on your PC.




