= CHAPTER 5 Access More Skills 13 Specify Relationship Join Types Database objects forms, queries, and reports display fields from related tables by matching the values between the fields common to both tables. By default, these objects match records using an inner join a query join type that displays a record only when the common field between two related tables has a matching value in both of the tables. Access supports join types in addition to the inner join. These join types are used to display all the fields from one table, even when there is no matching record in the other table. Join types can be changed in the Relationships window or in query Design view. Changing the join type in the Relationships window affects all database objects that depend on the relationship. Changing the join type in a query affects only that query. To complete this database, you will need the following file: a05_volunteers You will save your database as: Lastname_Firstname_a05_Volunteers 1. Start Access and open the student data file a05_volunteers. Click the File tab, click Save Database As, and then Save the file in your Access Chapter 5 folder with the name Lastname_Firstname_a05_Volunteers If necessary, enable the content. Add Advanced Report Features Microsoft Access Chapter 5 More Skills: SKILL 13 Page 1 of 6
2. In the Navigation Pane, under Queries, right-click Volunteers without Assignments, and then click Design View. Compare your screen with Figure 1. This query depends on the relationship between the Volunteers and Assignments tables. The relationship line between the two tables indicates an inner join will be used. The query will display only the names of volunteers that have a matching Volunteer ID in the Assignments table. Inner join relationship Figure 1 3. From the Results group, click the Run button. Scroll through the query results and notice that every volunteer listed has at least one job assigned. 4. Click the View button to return to Design view. In the Job ID column Criteria box, type Is Null 5. Run the query, and then notice that no records are returned with this criteria. With the inner join type, the query does not display the volunteers that have never had a job assigned because they do not have a matching record in the second table. Add Advanced Report Features Microsoft Access Chapter 5 More Skills: SKILL 13 Page 2 of 6
6. Switch to Design view. In the query workspace, right-click the relationship line between the two tables. From the shortcut menu, click Join Properties. If your shortcut menu does not display the Join Properties command, try again taking care to place the tip of the pointer in the middle of the relationship line when right-clicking. Compare your screen with Figure 2. Join types are specified in the Join Properties dialog box. The first option is an inner join. The second option specifies a left outer join a join type where every record in the one side of the relationship displays even if there is no matching record in the table on the many side of the relationship. The third option specifies a right outer join a join type where every record in the many side of the relationship displays even if there is no matching record in the table on the one side of the relationship. Inner join option Left outer join option Right outer join option 7. In the Join Properties dialog box, select the second option button, and then click OK. The relationship line has an arrow pointing to the table on the many side of the relationship indicating a left outer join will be used. 8. Run the query. Notice that one volunteer, Cruz Monsky, has never been assigned a job. Figure 2 9. In the Append row, click in the First Name box, and then type your first name. Press F and then type your last name. Add Advanced Report Features Microsoft Access Chapter 5 More Skills: SKILL 13 Page 3 of 6
10. Compare your screen with Figure 3, and then Save the query. If you are to print your work, print the query datasheet. Volunteers with no matching records Figure 3 11. Close the query. In the Navigation Pane, under Queries, double-click Jobs without Volunteers. The query currently uses an inner join to display all jobs that have a volunteer assigned. 12. Switch to Design view. Right-click the relationship line between the Triathlon Jobs and Assignments tables. From the shortcut menu, click Join Properties. Select the second option button, and then click OK. The relationship line has an arrow pointing to the table on the many side of the relationship indicating a left outer join will be used. Add Advanced Report Features Microsoft Access Chapter 5 More Skills: SKILL 13 Page 4 of 6
13. Right-click the relationship line between the Assignments and Volunteers tables, and then from the shortcut menu, click Join Properties. Select the third option button, and then click OK. Compare your screen with Figure 4. The relationship line between the Assignments and Volunteers tables has an arrow pointing to the table on the one side of the relationship indicating a right outer join will be used. Left outer join Right outer join 14. Run the query. In the query results, notice that three jobs have no volunteer assigned. 15. Switch to Design view. In the First Name column Criteria box, type Is Null Figure 4 16. Run the query to display the three unassigned jobs. Save, and then Close the query. 17. With the Jobs without Volunteers query selected, display the Create tab. In the Reports group, click the Report button. 18. Click the Job ID label to select it. On the Arrange tab, in the Rows & Columns group, click the Select Column button, and then press X. Repeat this technique to delete the Volunteer ID column. 19. Switch to Design view. In the Controls group, click the Label button. 20. In the Report Footer, position the crosshairs of the pointer on the 5 inch horizontal grid line and one grid dot below the top of the Report Footer. Click one time, and then using your own name, type Lastname_Firstname_a05_Volunteers 21. On the status bar, click the Layout View button to switch to Layout view. In the Themes group, click the Themes button, and then click the third thumbnail in the second row Austin. 22. Click the control with the file name, display the Format tab, and then change the font size to 9. Add Advanced Report Features Microsoft Access Chapter 5 More Skills: SKILL 13 Page 5 of 6
23. Click the control with the text Page 1 of 1, and then press X. 24. Click the Count control with the text 3, and then press X. 25. Switch to Report view, and then compare your screen with Figure 5. If you are to print your work, print the report. Figure 5 26. Click Save, click OK, and then Close the report. 27. Exit Access. Submit your printouts or submit the database file as directed by your instructor. You have completed More Skills 13 Add Advanced Report Features Microsoft Access Chapter 5 More Skills: SKILL 13 Page 6 of 6