Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

One to Many, how handle in report ???

Status
Not open for further replies.

gazolba

Programmer
Dec 4, 2001
167
US
I have to print a report on a record. This record may be pointed to by multiple other records in a different table.
I need to list all these other records that point to it, in the report.

e.g.
Main table:
ID = 999

Reference Table:
ID = 1 ref = 999
ID = 2 ref = 888
ID = 3 ref = 999

My report needs to list all the details in the Main Table plus ID 1 and ID 3 from the other table.

Would I do this in a sub-report? If so, how?
 
Can't you create a query based on both tables with the Main table ID joined to the Reference table Ref? Then use this as the record source for a report.

Duane
MS Access MVP
Find out how to get great answers faq219-2884.
 
I suppose I could but then I'd end up with a much bigger table since the records would be duplicated for each alternate reference. I thought there might be a better way.
 
I guess I don't understand what you want your report to look like. Please enter a few sample records from your tables and then how you want them to appear in the report.

Duane
MS Access MVP
Find out how to get great answers faq219-2884.
 
Main table:
ID = 900
ID = 999

Reference Table:
ID = 1 ref = 999
ID = 2 ref = 900
ID = 3 ref = 999
ID = 4 ref = 900
(there is an unlimited number of pointers to a main table record)

Report:
900
2
4
999
1
3

 
Just create a report based on Reference that Groups by [Ref]. Place the Ref field in the group header and ID in the detail section.

Duane
MS Access MVP
Find out how to get great answers faq219-2884.
 
Well its not that simple. My illustration was greatly simplified. The report is much more complex than that and I have several groups of repeating items.
 
I'm not sure how anyone can help if you don't provide the amount of detail that your solution requires.

Duane
MS Access MVP
Find out how to get great answers faq219-2884.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top