MIS5140-Fall2020-THX10
MIS5140-Fall2020-THX10
Take-Home Exercise #10 (Your sample data will be different than shown here.)
Define the relationships making sure that Enforce Referential Integrity is checked.
1|Page
Step 3. Let Access automatically enforce the “tuple type” semantic integrity constraint that the
EndDate of any Trip must be past its StartDate.
2|Page
Step 4. Edit Customer Table and change the record named Student’s to your own information:
Step 6. Write a query to list all trips starting after 12/31/2020 under $3,000 in alphabetical order
of destination. Save the query as Q1-TripsUnder3K
Step 7. Write a query to list all upcoming trips along with their length/duration in descending
order of their length. Save the query as Q2-TripLengths. (Sample outputs shown could be different
in your database.)
3|Page
Step 8. Write a query to list all upcoming trips along with the expected number of persons
traveling. Order by StartDate. Save the query as Q3-UpcomingTripPeopleCount
Step 9. Write a query to list all fitness levels along with the number of trips in that category.
Save the query as Q4-TripsByFitnessLevel
4|Page
Step 10. Write a query for a report to be designed. The query should pull together all needed data
for the report. For all customers, list trips registered and the total revenue from that customer.
Save the query as Q5-CustomerRevenueReport
Step 11. Use the Report Wizard to create the following report based on this query.
5|Page
6|Page
7|Page
Finished Report:
……..
8|Page
Step 12. Let’s start designing a Menu form to run our queries and reports. This form will not be
“bound” to any underlying table.
9|Page
10 | P a g e
Step 13. Now that we added an Image, let’s continue by adding a Button.
Next, we’ll change the Name property of the button to read: cmdQ1 and its Caption property to
Upcoming Trips Under $3,000
11 | P a g e
DoCmd.OpenQuery "Q1-TripsUnder3K", acViewNormal, acReadOnly
12 | P a g e
Step 14. Let’s add additional command buttons in similar manner. And, include one to display
our Customer Revenue Report.
13 | P a g e
Step 15. Now, let’s create a form for browsing, editing, and adding (even deleting) trips. We’ll
use the Form Wizard to start us:
14 | P a g e
In design view, we begin by selecting the Text Box and right clicking to request changing it to a
Combo Box.
15 | P a g e
Next, we need to indicate where the Fitness Level descriptions should come to be displayed in
the combo box:
We also need to change a few properties unde the Format tab of the property sheet:
16 | P a g e
Step 16. Now, let’s create a form for browsing, editing, and adding (even deleting) registrations.
Again, we’ll let the Form Wizard to start us. Similarly, we’ll change the CustomerNo, and the
TripNo text boxes to combo boxes to present a more friendly way of seeing/adding data.
The Row Source property of CustomerNo will be specified by the following query:
17 | P a g e
We’ll make sure to indicate 3 columns for the combo box and set the width of the first one to 0”.
The Row Source property of TripNo will be specified by the following query:
We’ll make sure to indicate 4 columns for te combo box and set the width of the first one to 0”.
18 | P a g e
Step 17. Let’s open the Trip form in design view and add a subform control to it:
19 | P a g e
20 | P a g e
Also, change the Default View of the Registration Subform’s FORM to Datasheet:
21 | P a g e
22 | P a g e
Step 18. Let’s add our Trip form to the menu:
End Sub
That’s It!
23 | P a g e