• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 16. Advanced Report Design > Creating and Embedding a Subreport

Creating and Embedding a Subreport

In many of your reports, you will probably design the Detail section to display a single line of information from the underlying record source. As you learned earlier in this chapter, it’s fairly easy to link several tables to get lots of detail across several one-to-many relationships in your database. You also saw how to use the Hide Duplicates property to display a hierarchy across several rows of detail.

However, as with forms and subforms, which you learned about in Chapter 13, “Advanced Form Design,” you can embed subreports (or subforms) in the Detail section of your report to display multiple detail lines from a table or query that has a many relationship to the one current line printed in the Detail section. You must use this technique when you want to display information from more than one many relationship on a single page. In the LawTrack Contacts database, for example, if you want to provide details about contact events and products owned by a contact, you must use subreports. You could create a very complex query that joins all the information, but you’d get one row for each unique combination of contact event and product. If a contact has 100 events and owns six products, each of the six product rows is matched with each of the 100 contact event rows. You’ll get 600 rows for that contact in a query that joins the tblContacts, tblContactEvents, and tblContactProducts tables—each product record appears 100 times, and each contact event record appears six times.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint