12.07.2015 Views

Microsoft Access Tutorial B - Cengage Learning

Microsoft Access Tutorial B - Cengage Learning

Microsoft Access Tutorial B - Cengage Learning

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

The second step is to make a form based on the query. This works because the queryknows about all the fields. Tell the form to display all fields in the query. (Common fields—here, SSN—would appear twice, once for each table.)Forms with SubformsYou can also make a form that contains a subform. This application would be particularlyhandy for viewing all hours worked each week by employee. Before you create a form thatcontains a subform, you must form a relationship between the tables. Suppose that you wantto show all the fields from the EMPLOYEE table, and for each employee, you want to showthe hours worked (all fields from the HOURS WORKED table).Join the TablesTo begin, first form a relationship between those two tables by joining them: Choose theTables object and then choose Tools-Relationships. The Show Table dialog box will pop up.Add the EMPLOYEE table and the HOURS WORKED table. Drag your cursor from theSSN field in the EMPLOYEE table to the SSN field in the HOURS WORKED table.Another dialog box will pop up, as shown in Figure B-88.Figure B-88The Edit Relationships dialog boxClick the Join Type button, and choose Number 2: Include ALL records from ‘Employee’and only those records from ‘Hours Worked’ where the joined fields are equal, as shown inFigure B-89.Figure B-89The Join Properties dialog box52 <strong>Tutorial</strong> B

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!