Practice Activities

 
 

Lesson 7: Query Design

Try This: Do the following steps
1. Open the Brown Bag Lunch database you have been programming. Or you may download the sample database Brown Bag Lunch ver7.accdb online.

2. Use the Query Wizard to create a Select Query with tblProducts as the Record Source.

3. Select  the following Fields in the Query Wizard,: ProductID, Type, Item, and Specialty.

4. Name the Query ItemSQ and Finish the Wizard.

5. Open the ItemSQ Query in Design View. Use the QBE grid to set the Sort Order for the Specialty Field as Descending. Run the Query to verify that is Sorts with Vegetarian on the top.

6. Return to Design View. In the QBE grid, enter the Criteria “Gluten Free” to the Specialty Field. Run the Query to test that only Gluten Free items are displayed.

7. Return to Design View. In the QBE grid, add a new Field: Type. Set the Sort Order as Ascending. Run the Query to test it, again.

8. Return to Design View. Remove the Criteria “Gluten Free” from the Specialty Field.

9. Rearrange the fields in the QBE grid so that Specialty is to the left of Type. Run the Query to test it one more time. The Query should Sort by Specialty in Descending order (with vegetarian on top) and then by Type in Ascending order (with breakfast first.)

10. Save the ItemSQ Query.

11. Close your Mighty Access dartabase,