Access - Workbook Three: Exercise 1
Access - Workbook Three: Exercise 1
This workbook assumes that you have previous experience of using Microsoft
Access and can create Tables, Queries and Reports.
Exercise 1
Open Access
New database
Filename: Crop database
Variety Text 20
Name Text 20
Code No Text 4
Crop Time Text 10
Close table
Create New Table 2 within the same database. Save it as Crop Prices
Code No Text 4
Page Ref Number Long Integer
Amount Sold Number Long Integer
Price Currency 2 places decimals
Input Data
(for the tables you can import them from excel. Go to the External Data tab
and click on Excel file. The first database is saved as crop varieties and the
second as crop prices. Import them into your database to save time)
Close table
Relationships
Click on Database Tools and choose Relationships. Add both tables as seen
below
When both tables have been selected, close the window. Click in Code No
from the first table and drag into Code No in the second table. This will
bring up the following window.
Click Create and a line will now join the 2 tables. There is now a relationship
between the 2 tables.
Create the following queries based on the 2 joined tables. The tables will be
joined via the CodeNo field (primary key)
You can only join two tables if they have the same field in both of the tables.
This saves you having to create two separate queries and also brings all your
data together into one.
Perform New Query as usual to find all Spring Varieties; add both tables
to the grid
Fields to show in this order:
CropTime,
Code Number, (from either table)
Name,
PageRef,
Price
Use the same query in Design View and change criteria for the following
query.
Report
The following steps will enable you to produce a Report, based on the 2
tables, using the Report Wizard.
A Query must be created first so that the required fields from the 2 tables
will be available.
Run Query
Create a simple report via the Report Wizard. Base it on the query
“Complete List” and include all the fields.
Choose to group the report on Variety and sort it on the field Name. In
the summary details sum the Amount Sold field.
Choose to lay the report in landscape, and select any style that you prefer.
Forms
A form is a database object that you can use to enter, edit, or display data
from a table or a query. You can use forms to control access to data, such as
which fields or rows of data are displayed.
Create a form for the Crop Varieties table using the wizard
Choose the crop variety table, use all of the fields, and choose Columnar
Style
Choose any style for the form, and enter the name frmcropvarieties
Last Record
New Record
Click on the crop varieties table to see the record has been entered (you
may need to close the form and table and reopen to see the new record)
Using the same method as before, create a form for the Crop prices table
and enter the following new record
Exercise 2
This exercise represents an extract from a Travel Agency database and the
creation of 2 related tables
ENTER DATA
Change widths
Save Structure
Save
Manipulation of data
Print Datasheet
Change Font
Home Tab
Font …
Choose Arial 12
Print datasheet
Create Tab
Table
Click on View
Save the table as State of Bookings
Save button
Enter data
1 23 No
2 30 No
3 50 Yes
4 15 No
5 65 Yes
6 50 Yes
7 42 No
8 33 No
Change Font
Arial 12
Save the table
Print datasheet
Close table
Click on the Database Tools Tab, click on Relationship icon. Add both tables,
click in the Tour No field in the first table and drag it into the Tour No field
in the second table.
Click Create
Simple Query 1
The 2 tables have a common field - TOUR NO. This enables you to join the
tables to create a larger table with more possibilities
Create a new query in design view and add both tables to the grid
We want to find the Resorts and Hotels that are already full
Add the fields TOUR NO, FULL and RESORT to the grid.
Show TOUR NO, HOTEL, RESORT, Full and PRICE fields only (although you
are not going to show FULL field you will need to insert it into the grid as
you are going to use it for one of the criteria)
Uncheck Show box in FULL column (this field will not now show)
Run Query
Save Query - List of Hunstanton Hotels with vacancies
Print result of query to show the hotels which are not yet full (Printout
8)
Close Query
Close database file and assemble your printouts
Report
Create a report based on the tour details table, with the grouping level set
for Resort
Landscape