Report displaying a parent and child

J

Joey

I have an export from Excel that I have imported into Access. There are 3
columns, code, parent and child. The Code column is the unique identifier.

It looks like this::

Code Parent Child Child Number
VWMM Greg Frank 1212345
VWMM Greg Sue 1214456
MWNN Lilly Andy 1217766
MWNN Lilly Tony 1218878
MWNN Lilly Sam 1459099

I would like to have the report look like this:

VWMM Greg

Frank 1212345
Sue 1214456

MWNN Lilly

Andy 1217766
Tony 1218878
Sam 1459099

Is this even possible?

Jo
 
C

Cheese_whiz

Hi Joey,

Open your report in design view. In the view menu at the top, choose
sorting/grouping. In the top/left box of the window that opens, choose the
parent field. Once you choose the parent field (and while the cursor is
still in that box where the parent field is displayed), look at the bottom of
that sorting/grouping window and make sure the 'show header' is set to 'yes',
the 'group on' is set to 'each value', and the 'Group Interval' is set to
'1'. I'm pretty sure that's all you need...

Then close that sorting/grouping window and look at your report. Hopefully,
you'll see a 'parent header' portion of the report. You may need to separate
(drag) the parent header from the detail section so that there is room to put
a control for the parent field in the parent heading section.

In the detail section, you'd put controls to display the kids.

Your report will also have a report header and footer, and you will probably
want a page header and footer (so you can display the date and maybe the
report page number.....stuff like that). Note: I didn't tell you to set the
group footer to 'yes' in the sorting and grouping for the parent field, but
you may want to (or maybe not). I've always used that footer to show a count
of the records in the group, but in your case it may not really be
necessary.......not sure you need a count of how many kids there are for a
parent. That's up to you.

One last thing. Here's some code I use for the recordsource of a control in
a group on a report of mine that is equivlent to your 'parent' field. You
may want to try it out. It might not matter for this report, but it
certainly works well when you want to group on something that may be null for
some records:

=IIf([HasData],[CategoryType],"No Matching Group")

Replace my field, [CategoryType], with your field, [Parent?]. In my report,
this code will group on category type for all the records that HAVE a
category type, and create a separate group titled 'No Matching Group' for any
record that does NOT have a category type. File it away if you don't need it
now. If you make many reports, it probably will come in handy later.

Hope that helps,
CW
 
J

Joey

Thank you so much! Excellent instructions!

Cheese_whiz said:
Hi Joey,

Open your report in design view. In the view menu at the top, choose
sorting/grouping. In the top/left box of the window that opens, choose the
parent field. Once you choose the parent field (and while the cursor is
still in that box where the parent field is displayed), look at the bottom of
that sorting/grouping window and make sure the 'show header' is set to 'yes',
the 'group on' is set to 'each value', and the 'Group Interval' is set to
'1'. I'm pretty sure that's all you need...

Then close that sorting/grouping window and look at your report. Hopefully,
you'll see a 'parent header' portion of the report. You may need to separate
(drag) the parent header from the detail section so that there is room to put
a control for the parent field in the parent heading section.

In the detail section, you'd put controls to display the kids.

Your report will also have a report header and footer, and you will probably
want a page header and footer (so you can display the date and maybe the
report page number.....stuff like that). Note: I didn't tell you to set the
group footer to 'yes' in the sorting and grouping for the parent field, but
you may want to (or maybe not). I've always used that footer to show a count
of the records in the group, but in your case it may not really be
necessary.......not sure you need a count of how many kids there are for a
parent. That's up to you.

One last thing. Here's some code I use for the recordsource of a control in
a group on a report of mine that is equivlent to your 'parent' field. You
may want to try it out. It might not matter for this report, but it
certainly works well when you want to group on something that may be null for
some records:

=IIf([HasData],[CategoryType],"No Matching Group")

Replace my field, [CategoryType], with your field, [Parent?]. In my report,
this code will group on category type for all the records that HAVE a
category type, and create a separate group titled 'No Matching Group' for any
record that does NOT have a category type. File it away if you don't need it
now. If you make many reports, it probably will come in handy later.

Hope that helps,
CW

Joey said:
I have an export from Excel that I have imported into Access. There are 3
columns, code, parent and child. The Code column is the unique identifier.

It looks like this::

Code Parent Child Child Number
VWMM Greg Frank 1212345
VWMM Greg Sue 1214456
MWNN Lilly Andy 1217766
MWNN Lilly Tony 1218878
MWNN Lilly Sam 1459099

I would like to have the report look like this:

VWMM Greg

Frank 1212345
Sue 1214456

MWNN Lilly

Andy 1217766
Tony 1218878
Sam 1459099

Is this even possible?

Jo
 
C

Cheese_whiz

Thanks! Glad I could help.
CW

Joey said:
Thank you so much! Excellent instructions!

Cheese_whiz said:
Hi Joey,

Open your report in design view. In the view menu at the top, choose
sorting/grouping. In the top/left box of the window that opens, choose the
parent field. Once you choose the parent field (and while the cursor is
still in that box where the parent field is displayed), look at the bottom of
that sorting/grouping window and make sure the 'show header' is set to 'yes',
the 'group on' is set to 'each value', and the 'Group Interval' is set to
'1'. I'm pretty sure that's all you need...

Then close that sorting/grouping window and look at your report. Hopefully,
you'll see a 'parent header' portion of the report. You may need to separate
(drag) the parent header from the detail section so that there is room to put
a control for the parent field in the parent heading section.

In the detail section, you'd put controls to display the kids.

Your report will also have a report header and footer, and you will probably
want a page header and footer (so you can display the date and maybe the
report page number.....stuff like that). Note: I didn't tell you to set the
group footer to 'yes' in the sorting and grouping for the parent field, but
you may want to (or maybe not). I've always used that footer to show a count
of the records in the group, but in your case it may not really be
necessary.......not sure you need a count of how many kids there are for a
parent. That's up to you.

One last thing. Here's some code I use for the recordsource of a control in
a group on a report of mine that is equivlent to your 'parent' field. You
may want to try it out. It might not matter for this report, but it
certainly works well when you want to group on something that may be null for
some records:

=IIf([HasData],[CategoryType],"No Matching Group")

Replace my field, [CategoryType], with your field, [Parent?]. In my report,
this code will group on category type for all the records that HAVE a
category type, and create a separate group titled 'No Matching Group' for any
record that does NOT have a category type. File it away if you don't need it
now. If you make many reports, it probably will come in handy later.

Hope that helps,
CW

Joey said:
I have an export from Excel that I have imported into Access. There are 3
columns, code, parent and child. The Code column is the unique identifier.

It looks like this::

Code Parent Child Child Number
VWMM Greg Frank 1212345
VWMM Greg Sue 1214456
MWNN Lilly Andy 1217766
MWNN Lilly Tony 1218878
MWNN Lilly Sam 1459099

I would like to have the report look like this:

VWMM Greg

Frank 1212345
Sue 1214456

MWNN Lilly

Andy 1217766
Tony 1218878
Sam 1459099

Is this even possible?

Jo
 
Top