Hello Janice,
Thank you so much for reading Chapter 35: Working with Subforms and Subreports in the Microsoft Access 2010 24-Hour Trainer book and for posting your question here! You said:
Quote:
...when my reports appear in the subform only one report in the database shows all records. ... my form is not exactly the same as the lesson example. My subform is on a page, in a tab control, on my form. But why this would effect all but one of my four reports I don't know.
|
So, my guess to fixing your problem would be to check the "Link Master Fields" and "Link Child Fields" properties of the Subform/Subreport control. If you just want to show each report AS-IS (without automatic filtering from the record selected in the parent form), just leave both of those properties blank. Does this make sense and does that solve your issue?
One thing that is not mentioned in the book (that I should probably have mentioned and I apologize for) is how the settings for the "Link Master Fields" and "Link Child Fields" properties of the Subform/Subreport control affect the data shown inside of the Subform/Subreport control. When the "Link Master Fields" and "Link Child Fields" properties are set for the Subform/Subreport control, the data source of whatever object that is shown in the control is filtered on the record that is selected in the parent form. Does that make sense?
For example, using the Northwind sample database, if I create a new form, set it's "Record Source" property to the "Orders" table, I have a simple form that is tied to the records in the "Orders" table. Now, if I drop a Subform control (from the Form Design Tools Ribbon, and NOT by grabbing the Form from the Navigation Pane) onto the new Form, and simply set it's "Source Object" property to the "Order Details" table, it will show ALL "Order Details" records in the table, no matter what is selected in the parent form.
But, let's say I want the Subform control to show ONLY the "Order Details" records for the particular "Order ID" of the record that is selected in the PARENT form. In that case, I can set the "Link Master Fields" property to the "Order ID" field (from the "Orders" table) and "Link Child Fields" property to the "Order ID" field (from the "Order Details" table), and now the Subform control auto-magically filters the "Order Details" records shown in the control based upon which "Order" record is selected in the Parent form. Pretty AWESOME stuff and you didn't even have to write a query to make this functionality possible!!!
One other thing that is not mentioned in Chapter 35 (that I should probably add in the next edition) is that when you drop a Form/Report from the Navigation Pane on to another Form or Report (to create the subform/subreport control), it starts the "Subform wizard" and depending on the choices that were made in that wizard, Access MAY automatically set the "Link Master Fields" and "Link Child Fields" properties for the Subform/Subreport control.
Anyway, I hope this information helps solve your problem, but if you have any more questions, please let me know and I'll do my best to provide a solution. And thank you again for reading the Microsoft Access 2010 24-Hour Trainer book, we truly appreciate your readership!
Thanks,