Others

How to Return Multiple Child Values for Each Parent in Microsoft Access

Olivia MillerOlivia Miller Oct 29, 2026 869 views

Question details

The user needs to display multiple associated child records grouped alongside their corresponding parent name.

How to Return Multiple Child Values for Each Parent in Microsoft Access
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.
Before you start

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.

Solution 1Recommended

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.

1
Open the VBA Editor

Press ALT + F11 to open the Visual Basic for Applications (VBA) editor and insert a new module from the top menu.

2
Add a Concatenation Function

Paste a standard concatenation function script (such as ConcatRelated) into the module and save it.

3
Call the Function in a Query

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.

Concatenate Child Values Using a Custom VBA Function
Macro Security: If your concatenation function returns an error, ensure that macros and VBA code are enabled in your Access Trust Center settings.
Free Microsoft Office alternative

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. 1. Download the Installer: Visit the official WPS Office website and download the free installation file for your operating system.
  2. 2. Install WPS Office: Run the downloaded file and follow the on-screen prompts to install the suite on your device.
  3. 3. Open and Create: Launch WPS Office to start opening, creating, or editing your documents, spreadsheets, and presentations immediately.
Fully compatible with Microsoft Word, Excel, and PowerPoint file formatsLightweight installation that won't slow down your computer's performanceBuilt-in PDF editing, conversion, and annotation toolsFree to download with a familiar and user-friendly ribbon interface
microsoft office alternative - wps office

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.