Lesson 8: The Producers
Try This: Do the following steps
1. Open the Brown Bag Lunch database you
have been working on.
Or, you may download
BBL Adv ver8.accdb.
2. Create a Select Query and add the
following Record Sources: tblReceiptProducts, tblProducts. JOIN the
Tables by Key data:
From ProductID in tblReceiptProducts to ProductID in tblProducts.
3. Add the following Fields to the QBE
Grid:
From tblReceiptProducts: ReceiptID, DateReceipt, CustomerID.
From tblProducts: Specialty, Type, Description, Price
Sort by Specialty (ascending)
4. Save the Query as rptLastProductOrdered.
Run the Query to test it.
5. Return to the Design View and create a
Control that calculates the difference between the date on the Receipt
and today’s date.
DaysSinceLastOrder:
DateDiff("d",[DateReceipt],Now())
6. Save the Query and Run it again. This Query should calculate the days
from today to the date on the Receipt.
7. Close the Query. You can use this as a
Subreport if you wish.
8. Close the Brown Bag Lunch database.