Lesson 5: Advanced Form Design, part 2
Try This: Do the following steps
1. Open the Brown Bag Lunch database you
have been working on. Or, you may download
BBL Adv ver5.accdb
2. Create a Select Query and choose
tblCustomers for the Record Source. Add all of the Fields to the QBE
Grid.
3. Add a new Concatenated field as follows:
FullName: [FirstName] &" "& [LastName]
4. Add another Concatenated Field as
follows:
CityStateZip: [City]&", "&[State]&" "&[Zip]
5. Save the Query as CustomerNameSQ.
6. Create another Select Query. Choose
tblReciept for the Record Source.
7. Add a Query: CustomerCompanySQ. Create a JOIN from CustomerID in
tblReceipt to Customer ID in CustomerNameSQ.
8. Add the following Fields to the QBE Grid
from tblReceipt: ReceiptID, CustomerID, and Date/Time.
9. Add the following Fields to the QBE Grid
from CustomerNameSQ: Company, FullName, Phone, and CityStateZip.
Save
the Query and name it: ReceiptSQ.
10. Create the Receipt Form in with the
Form Wizard and select ReceiptSQ as the Record Source. Choose the
Columnar Layout. Enter the label: Customer Receipt.
11. Format the Form Header and include the
Brown Bag Logo.JPG. Format the logo 1” x 1”
12. Move the ReceiptID Control and Label to
the Form Header.
13. Select the CustomerID Control and
delete it. Create a Combo Box Control and select CustomerNameSQ for the
Record Source. Select CustomerID and FullName from the available Fields.
Sort by Customer (Ascending). Hide (resize) the Key Column for
CustomerID to be zero. Select CustomerID from the available Fields and
Store CustomerID. Enter the Label: Customers.
14. Save the Form: Receipt. Test the Form
in Form View. Does the Customer Combo work?
15. Return to Design View and add the
Subform with the Subform/Subreport Control. Use an existing Form:
ReceiptProductsSubform. Define your own JOIN:
ReceiptID to ReceiptID
CustomerID to CustomerID
Date/Time to DateReceipt
16. Finish the Wizard and Save the Form.
17. Test the Form in Form View. Select a
customer: Andrea Carter. Select two products: Avocado Wrap and Bacon,
Egg & Cheese. Save this Record.
18. Go to Receipt 2. Select a customer:
Selena Sullivan. Select two products: Breakfast Burrito, Chips and
Salsa. Save this Record.
19. Close the Receipt Form. Close the Brown
Bag Lunch database.