PC Review


Reply
Thread Tools Rate Thread

How to display data from mulple child records in single report line

 
 
Tim Callahan
Guest
Posts: n/a
 
      29th Sep 2003
Hello,

I have two tables, a parent and a child. THere is a 1 to
many relationship from the parent to the child.

I have a simple report that lists the contents of the
parent table. I want one field to be a concatenation of
data from the related child record(s).

This is currently working by using calling a function e.g.
=GetChildRecordValues([ParentId]) that runs a parameter
query and iterates through the results, and returns a
string with the concatenated child record values.

I suspect that this is a slow process and wanted to know
if there might be a higher performance way of doing this.

Thanks in advance,

Tim
 
Reply With Quote
 
 
 
 
Larry Linson
Guest
Posts: n/a
 
      30th Sep 2003
It is likely that if you join both tables in a Query and use that Query as
the basis of your report that it will perform better. However, if you are
now concatening the values into a string, it will, of necessity, look
different, because you'll show them in separate lines.

Larry Linson
Microsoft Access MVP

"Tim Callahan" <(E-Mail Removed)> wrote in message
news:06e401c386ae$6cfd7fd0$(E-Mail Removed)...
> Hello,
>
> I have two tables, a parent and a child. THere is a 1 to
> many relationship from the parent to the child.
>
> I have a simple report that lists the contents of the
> parent table. I want one field to be a concatenation of
> data from the related child record(s).
>
> This is currently working by using calling a function e.g.
> =GetChildRecordValues([ParentId]) that runs a parameter
> query and iterates through the results, and returns a
> string with the concatenated child record values.
>
> I suspect that this is a slow process and wanted to know
> if there might be a higher performance way of doing this.
>
> Thanks in advance,
>
> Tim



 
Reply With Quote
 
SA
Guest
Posts: n/a
 
      30th Sep 2003
Well, there are possibly two ways to do this that are much faster:

1.) Create a sub report which draws the data from the child tables only
(include the PK in the sub report query) and then link the maste report and
child reports by the key between the tables, placing the sub report in the
detail section.

2.) In your query use an outer join between the tables to include all rows
common on the key between the two tables. This will pull in all records
from the child table, and duplicate the data from the main table for each
row. Then for the fields that are duplicated set the hide duplicates value
to true.
--
Steve Arbaugh
ACG Soft
http://ourworld.compuserve.com/homepages/attac-cg

"Tim Callahan" <(E-Mail Removed)> wrote in message
news:06e401c386ae$6cfd7fd0$(E-Mail Removed)...
> Hello,
>
> I have two tables, a parent and a child. THere is a 1 to
> many relationship from the parent to the child.
>
> I have a simple report that lists the contents of the
> parent table. I want one field to be a concatenation of
> data from the related child record(s).
>
> This is currently working by using calling a function e.g.
> =GetChildRecordValues([ParentId]) that runs a parameter
> query and iterates through the results, and returns a
> string with the concatenated child record values.
>
> I suspect that this is a slow process and wanted to know
> if there might be a higher performance way of doing this.
>
> Thanks in advance,
>
> Tim



 
Reply With Quote
 
Marshall Barton
Guest
Posts: n/a
 
      30th Sep 2003
Tim Callahan wrote:

>I have two tables, a parent and a child. THere is a 1 to
>many relationship from the parent to the child.
>
>I have a simple report that lists the contents of the
>parent table. I want one field to be a concatenation of
>data from the related child record(s).
>
>This is currently working by using calling a function e.g.
>=GetChildRecordValues([ParentId]) that runs a parameter
>query and iterates through the results, and returns a
>string with the concatenated child record values.
>
>I suspect that this is a slow process and wanted to know
>if there might be a higher performance way of doing this.


Not to disagree with everyone else, but I like the way
you're doing it better than the alternatives. In general,
reports use so much processing power that you probably won't
notice an delay caused by this operation.

You might be able to speed things up a little by indexing
the table on the field you're using to filter the data (you
probably already have this since the tables are related).
It might also bea little faster to open the recordset using
dbForwardOnly and dbReadOnly.

--
Marsh
MVP [MS Access]
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Multiple records in table to display single records Hurrikane4 Microsoft Access Queries 7 10th Dec 2009 06:34 PM
Display Child Records in subform Zorkmid Microsoft Access Forms 7 22nd Sep 2009 10:20 AM
Re: child records on the report John W. Vinson Microsoft Access Form Coding 0 8th Jun 2009 12:35 AM
How2:Display data from multiple Records on one line seperated byCommas Phil Smith Microsoft Access Reports 1 12th Oct 2007 08:42 PM
How to display a field from multiple records into a report line? =?Utf-8?B?cmF5dA==?= Microsoft Access Reports 6 8th May 2004 07:11 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:26 PM.