Sei sulla pagina 1di 31

Databases:

User-friendly
database design
Databases: User-friendly database design

About These Activities


Software Used
Access 2013
Windows

Files Used
Inventory.accdb
Pendleton Products.accdb
Woodstock Road Dentist.accdb

Finding the Exercise Files


All the files for these exercises have been provided for you on a network drive.
Your area of the drive is called the H ome Drive H: .
They can also be downloaded from the ITLC Portfolio (visit
http://portfolio.it.ox.ac.uk and search for “user friendly databases” or similar
search text to find the course pack for this course).

Trusted Locations
In the IT teaching rooms, the Home Drive has been set up as an Access Trusted
Location. To find out more about Access Trusted Locations, read the article in the
ITLC Portfolio (visit http://portfolio.it.ox.ac.uk and search for “Access trusted
locations” or similar search text).

Web App or Desktop Database?


Access 2013 can also be used to create an a p p da tab ase : where users work on
the data via a web browser. This would require communication using Office 365
or SharePoint 2013 (not currently available at Oxford University), and is not the
subject of this course. We will work on a d e s k t op d a t aba s e , which is saved
locally on your computer or a network drive.

Forms and Reports


An Access database typically contains a number of forms and reports, which are
based on the tables (where data is stored) and queries (where data is selected and
analysed).
A form is an interface for working on data: it is designed to appear on a computer
screen, where users can review existing data and edit it, and add new records and
new data values. A report collects some data from the database and presents it in
a layout that is suitable for looking over and interpreting: reports are not
interactive, and are often printed on paper (or similar).
In many ways, the same skills are used for working on forms and reports, so we
will explore them together. When you have tried out a skill on a form, see how
you get on applying the same skill on a report.

1 IT Learning Centre
Databases: User-friendly database design

Copyright

Pamela Stanworth makes this document and the accompanying slides available
under a Creative Commons licence: Attribution-NonCommercial-ShareAlike CC
BY-NC-SA. pamela.stanworth@it.ox.ac.uk
The Oxford University logo and crest and the IT Services logo are copyright of
Oxford University and may only be used by Oxford University members in
accordance with the University’s branding guidelines.

2 IT Learning Centre
Databases: User-friendly database design

Steps for the Learning Objectives


Learning Objective One: Opening a database file

In the Pendleton Products database, a small company is keeping track of its


employees, customers and orders

Step 1
Start Access Start the computer if necessary
Step 2

Click the Start button on the taskbar at the


bottom of the screen
In the S t a r t menu, type Access in the search box

Choose Ac cess

Step 3
If you are prompted for any user information, just click
on O K

Step 4
(On your office or home computer you may start the
program using an Access icon on the Desktop)
Step 1
Open Pendleton Choose F i le | O pe n
Products.accdb
Or click in the backstage view
It has been placed in your
Home Drive H:\ (or in Step 2
another place as directed by Browse to the Home Drive called d r iv e H : \
your teacher)
Alternatively, navigate to a drive and folder as directed
by your teacher
All the files you need for this course will be found here
Step 3
Locate the file called Pe nd le to n Prod uc ts .accdb
Open the file by selecting the filename then clicking

Step 4
If a security warning bar appears, stating that certain
content in the database has been disabled, then read
Appendix 1

3 IT Learning Centre
Databases: User-friendly database design

Look at the Relationships diagram to see the tables and joins in this database
In this database, a small business is keeping track of the orders it has received,
with the customers it deals with and the employees who manage the orders
When ready, close the Relationships diagram
Step 1
Look at the list of tables, In the Navigation Pane, notice that the names of tables
forms and other objects in and forms that have already been created are listed
the Navigation Pane Step 2
Data is stored in the tables
Forms are used for viewing or editing the data
Reports are for collecting the data and presenting it
Step 1
Run fr m Emp lo ye es In the Navigation Pane, find the form named
f r m Em p loy e e s
Edit some data values
Run it by selecting the form name and pressing ENTER,
or by double-clicking the form name
Step 2
This form shows just one record at a time; use the
navigation buttons (at bottom left) to move among the
records
Navigate to the record for Keith Simpson

Step 3
Use TAB and SHIFT+TAB to move among the fields of a
single record
Correct his salary to 20000 (do not type the £ symbol, it
will be added by Access as part of the currency format)
Step 4
Correct his middle name to Arthur
Close the form
Step 1
Try out a report In the Navigation Pane, find the report named
r p t Em p loyee s
Run it by selecting the report name and pressing
ENTER, or by double-clicking the form name
Step 2
This report shows all the employees’ records, with some
details of each person
Employee records are grouped under department
Step 3
Identify the row for Keith Simpson
Data cannot be edited in a report

4 IT Learning Centre
Databases: User-friendly database design

Step 4
A summary calculation at the bottom shows the salary
averaged over all the employees

Close all forms and reports, leaving the Navigation Pane and Pendleton
Products.accdb still open

5 IT Learning Centre
Databases: User-friendly database design

Learning Objective Two: Creating a form, starting from a blank

Task 1
Continue working in the file Pendleton Products.accdb
Task 2

Create a new form in Design View, by using on the C r ea t e tab of the ribbon
Task 3 Step 1
Show rulers and gridlines
On the Arrange tab, click

Step 1
Show the gridlines using , using
The gridlines will not show when the form is used
Step 2
Show rulers along the top and left edges of the form,
using

Task 4 Step 1
Extend the working area of Drag the right edge of the white working area, to make
the Detail the Detail space wider
Step 2
Drag the lower edge to make the Detail space deeper
Task 5 Step 1
Save the new form, calling Click or choose Sav e on the F i le menu, and save
it frmCus tomers the new form
Give a suitable name for the Call it frmCus tomers
form, with the prefix f r m
Step 2
Leave the form open for the next exercise
Step 3
Notice the new form name appears in the Navigation
Pane
Task 6 Step 1
Add a text box for the field
C ompan yNa me in the If the Field List is not visible, click
tb lC us to mers
Place it near the top of the Step 2
Detail section Click S ho w a l l t a b les
Click + beside tb lC us to me rs , to display the fields in
that table
Step 3
Drag the C om pa nyN ame field name from the Field
List and drop it onto the form, near the top of the Detail
area

6 IT Learning Centre
Databases: User-friendly database design

Step 4
When the mouse is let go, a new text box is added on the
form
The text box is automatically bound to the
C ompan yNa me field from the table tblCus to mers
Task 7 Step 1
Add more text boxes, In the Field List, click on C o n tac t F irs tN am e, then
placing them just below the hold SHIFT and click on Co n tac tLas tN ame
C ompan yNa me When both are selected, drag them onto the form just
below the CompanyN ame control
Step 2
Repeat this process, clicking
C ompan yOrD ep ar tmen t in the Field List, holding
SHIFT and clicking N o tes , then dragging these selected
fields onto the form
Step 3
Adjust the height and width of the form as necessary
Task 8 Step 1
Edit the label Select the label C o mpa ny N am e :
C om pan y N a me : to read Click inside the label box, until the insertion point
Company Name appears
Step 2
Edit the text to read Company Name

Step 3
Edit other labels if you wish
Task 9 Step 1
Move the four address text Select the B illin g Addr ess down to Country text
boxes into a space on the boxes
form, perhaps forming a (hold CTRL for multiple selection)
right-hand column Step 2
Move the selected boxes by dragging using the 4-headed
arrow pointer
Drop them in a space on the right of the form
Step 3
Move other text boxes as convenient
Task 10 Step 1
Resize the C o mp any Name Click on the C ompan yNa me label
label to be large
Step 2
Then use Size to Fit to Drag a corner handle to make the label rather larger
resize it again than is needed

7 IT Learning Centre
Databases: User-friendly database design

Step 3

On the Arrange tab, choose then choose


to fit the label neatly around its
text
Task 11 Step 1
Run the form and edit some
data Use to view your changes in Form View

Step 2
Enter or modify some data using the form
Task 12 Step 1
Close the form, saving Click to close the form
changes
Step 2
When prompted to save changes to the form design,
choose Y e s

8 IT Learning Centre
Databases: User-friendly database design

Learning Objective Three: Arranging controls on a form

Task 1 Step 1
Open Continue working in Pe ndle to n Pr odu c ts .acc db
fr mDe ta ilsO fCus tomers
in Design View Step 2
Right-click f r m D e t a ils O fC us to mers in the list of
forms then choose D es ig n V iew
Task 2 Step 1
Practice selecting several Click on the Ph on eNu mb er text box
objects by holding CTRL Hold CTRL and click on the Ex te ns ion box
while clicking objects
Hold CTRL and also click on the Em a ilAd dre ss box
Now all of three boxes are selected
Step 2
Drag all the selected boxes a little to the right
Step 3
When ready, click the grey desktop to deselect
everything
Task 3 Step 1
Rearrange the icon and the In the Form Header, there is a form icon and an orange
text box in the Form text box
Header, swapping them Drag the icon until it overlaps the orange text box
from front to back
Notice the way they are stacked – which one is in front?
Step 2

Use and to explore their effect on the


stacking order of the icon and the text box
Task 4 Step 1
Close the form Click to close the form
fr mDe ta ilsO fCus tomers ,
saving changes When prompted to save changes, choose Y e s

Task 5
Close the Pendleton Products database

9 IT Learning Centre
Databases: User-friendly database design

Learning Objective Four: Adding special controls on a form

Task 1
Open the database Woodstock Road Dentist.accdb
A group of dentists uses this database to keep track of the patients and
appointments
Look at the relationships diagram to see the tables and joins in this database
Task 2 Step 1
Open Right-click f r m N o t esF or P a t ie n ts in the forms list
f r mNo t es Fo r Pa t ie n ts in and choose D e s ign View
Design View Step 2
The form opens in Design View

Ensure that the Field List is visible (if not, click )

Task 3 Step 1
Add a display of the current Click on the F or m D es ig n T oo ls
time into the form footer
tab
Step 2
Clear I nc lu de D a te
Check I nc lud e T im e and choose a time format
Step 3
A T im e ( ) object appears near the top of the form
Step 4
Drag the lower edge of the grey Form Footer bar, to give
the Footer about 1cm depth
Step 5
Drag the T ime () object into a convenient space in the
footer
Task 4 Step 1
Insert a date picker control, Drag the field name D a te from the Field List and drop
for the D a t e field it onto the Detail section of the form
Note this is a field from the table, showing the date
when a note was made about the patient - do not
confuse this with today’s date which might be displayed
in the footer
Step 2
A control is created, bound to this field
Step 3
In Form View, this control will be presented with a
useful date picker

10 IT Learning Centre
Databases: User-friendly database design

Task 5 Step 1
Create a checkbox for the Drag the field name C opyG iv en To Pat ie n t from the
field C o pyGiv e nT o Pa t ie n t Field List and drop it onto the Detail section
Step 2
A checkbox is created, because this field was defined as
a Yes/No type in the Table Design
Task 6 Step 1
Try out the form in Form
View, adding a new note for Switch to Form View, using
one of the patients
Step 2
Try out the new controls which you have added
Add a new patient note with these details:
Note ID [automatic]
PatientID 3
Date Seen 30/11/2015
CopyGivenToPatient Yes

Task 7
Click to close the form, saving changes if prompted
Task 8
Open f r m Pat ie n ts Pla in in Design View
Task 9 Step 1
Delete the text box for the Select the T it le text box
T it le field
Step 2
Press DELETE to remove the box (with its label)
Task 10 Step 1
Create a combo box for Click , then click where the T it le box had been
people’s titles
The wizard starts
Use the wizard
Type the values: Mr, Mrs, Step 2
Ms, Miss, Dr In the first part of the wizard, choose I will ty pe in
t h e v a lu es t h a t I w an t
Step 3
Type the permissible values which your users will be
offered (one on each row):
Mr Mrs Ms Miss Dr

Step 4
Choose the name of the field where the value is to be
stored: T it le
Step 5
Finally type some helpful label text, such as
Give the person’s preferred title

11 IT Learning Centre
Databases: User-friendly database design

Task 11
Try out the combo box in Form View – change Peter Green from Mr to Dr
Task 12 Step 1
Add the title Prof to the In Design View, select the T it le combo box
Row Source list for the
Step 2
combo box
Set a default value of Mr
Display the Property Sheet (click on the D e s ign
tab) and look at the properties that have been set for this
combo box
Step 3
On the D a ta tab, click in the R ow S ourc e box and
type Prof at the end of the list
Take care to match the existing punctuation: use a
semicolon separator and enclose “Prof” in quotation
marks
Step 4
Click in the Default Value box and type Mr

Task 13
Try using the combo box to assign Titles to a few patients
Task 14
It would be good to record which school each patient attends (if any)
Schools are listed in tblSchool, but displaying the SchoolID on the form as a
number in a text box is not convenient for users
It would be better to offer a combo box where the user could choose a school
name from a list of names
Task 15 Step 1
Add a combo box for In Design View, click then click a space where the
choosing which school each
new combo box is to appear
patient attends (if any)
Step 2
In the wizard, opt to get the values from the table
t b lSc ho o l
Step 3
Choose to display the S c ho o lN a me and Ad dres s1
Step 4
Sort and adjust column widths as you prefer
Step 5
Choose to store the chosen value in the Sc hoo lID field
Step 6
On the form, resize the control and edit the label as you
prefer

12 IT Learning Centre
Databases: User-friendly database design

Task 16
Try using the combo box to assign schools to a few patients (not all patients go to
school)
Task 17
Plan ahead: how would you get an additional school name to appear on this list?
Task 18
Close the form, saving changes if prompted

13 IT Learning Centre
Databases: User-friendly database design

Learning Objective Five: Formatting controls and labels on a form

Task 1
Continue working in Pe ndle to n Pr odu c ts .acc db
Task 2 Step 1
Open Open the form f r mDe t a ilsO f C us t ome r s
fr mDe ta ilsO fCus tomers If necessary, right-click on the form name in the
in Design View Navigation Pane then select D es ig n Vie w
Step 2
Check that you are working in Design View
Step 3
Notice that the F o r m D es ig n T oo ls tabs appear
Task 3 Step 1
Use the Themes Gallery to
change the formatting Click on the D es ign tab, to display a gallery of
theme options
Step 2
Select any one of the themes
Step 3
Notice how the font, colours, and borders of the whole
form are affected
Task 4 Step 1
Change the font size for the Select the control for the field C o mp any N am e
C om pan y N am e field and
Step 2
make it bold
Change the font size to 18 point using the font tools
on the F or ma t tab

Step 3
Use a button to make this text bold

Task 5 Step 1
Change the fill and border Select the control for the Email Address field
colours for the Email
Step 2
Address field
Click the dropdown arrow for on the F o r m a t tab
and change the fill colour (e.g. to yellow)
Step 3
Click the dropdown arrow for on the F o r m a t tab
and change the border colour (e.g. to red)
Step 4
Experiment with changing the colours and borders of
other controls and labels, using the options on the
F or ma t tab

14 IT Learning Centre
Databases: User-friendly database design

Task 6 Step 1
Change the background Click on the background of the form
colour of the form detail (i.e. not on a control or label)
An orange border should appear around the Detail
section of the form
Step 2
Use on the Fo rm a t tab to change the background
colour of the form detail to something suitable
Task 7 Step 1
Run the form
Save changes Select to view your changes in Form View

Step 2
Click on the Quick Access Toolbar, to save this
form
Task 8

If necessary, display the Property Sheet, using on the D e s ign tab of the
ribbon
Task 9 Step 1
Look at the properties of Select the C om pa nyN ame control
the C o mp an yNa me control The properties of this control are now shown in the
in the Property Sheet – Property Sheet
those in the F or ma t page
will be as you set earlier, Step 2
using the buttons Click the F or m a t tab on the Property Sheet
Change one of the Notice that some of the formats set here are the values
properties you set earlier when you were using buttons
Step 3
This is an alternative way of making the same changes
you made earlier using toolbar buttons
With the C om pa nyN ame control selected, set the
Font Size to 18
Step 4
The Property Sheet offers many more properties
Change the Special Effect (on F o r m a t tab) to
Shadowed

Task 10 Step 1
Use the Property Sheet, Select the C ou n tr y /R eg io n control
D a ta tab, to set a default In the Property Sheet, click the D a t a tab
value of Oxon, for the
C oun t r y /R eg io n control Step 2
In the Default Value box, type Oxon

15 IT Learning Centre
Databases: User-friendly database design

Step 3
Now whenever a user creates a new record using this
form, the default value of Oxon will be entered
(the user can over-write this value as necessary)
Task 11 Step 1
Use the O t he r tab of the Select the N ot e s control
Property Sheet to enter a In the Property Sheet, click the O t h er tab
ControlTip text for the
N o tes control, such as Step 2
Please give any For the ControlTip Text, type Please give any
further relevant further relevant information here
information here
Now, when a user pauses the mouse pointer over the
Notes box, they will see a ControlTip with your message
Task 12 Step 1
Look at the properties of Use the combo box at the top of the Property Sheet to
the form itself display the properties of the Form itself

Give the form a caption Step 2


such as Pendleton In the Property Sheet, click the F o r m a t tab
Products, Lancs
Step 3
In the C a p t io n box, type Pendleton Products,
Lancs
Now this caption will appear on the title bar when the
users open the form in Form View
Task 13 Step 1
Examine the effects of your
changes in Form View Click to switch to Form View
Close and save the form
Notice all the changes you have made
Step 2
Return to Design View to make further changes if
necessary
Step 3
Close the form, agreeing to save changes if prompted
Task 14
Close the file Pe nd le ton Pr odu c ts .acc db leaving Access still open

16 IT Learning Centre
Databases: User-friendly database design

Learning Objective Six: Form structure

Task 1
Continue working in Woodstock Road Dentist.accdb
Open f r m Sch oo ls Pla in in Form View
Task 2 Step 1
Use TAB to move among the Press TAB a few times, slowly, and notice where the
fields on the form and focus (highlight) moves among the fields
examine the present tab The tab order does not match the layout of fields on this
order form
In Design View, change the Step 2
tab order to match the form
Switch to Design View
design
Test it in Form View
On the D es ig n tab, click

Step 3
In the T ab O r de r dialog, drag the field names up and
down the list, to arrange a better order

Finally, click to allow Access to suggest


an order based on the form design
Step 4
Finish the dialog
In Form View, try out the new tab order
Task 3 Step 1
Add a Form Header and In Design View, click on the D es ig n tab, to
Form Footer
add a new title
In the Header, add a title
Schools, and format it to
Step 2
be bigger The Header and Footer sections appear
Drag the grey horizontal dividing bars to extend the
Header or Footer space
Step 3
Select the new title object and move it to a suitable
position in the Header
Step 4
Use the buttons on the F o r m a t tab, to make the text
bigger and more eye-catching

Step 5
Edit the text to read Schools

17 IT Learning Centre
Databases: User-friendly database design

Task 4 Step 1
In the Footer, add a piece of Click in the Controls gallery then click (or drag) in
text, with interesting
the Footer to create a label
colours and formats
Step 2
Type text such as Enquiries to E Grundy in the
Footer label
Step 3
Use buttons such as and from the F o r m a t
tab, to apply colours and formats
Step 4
Switch to Form View and see the effect of your work
Task 5 Step 1
Rearrange the field controls Back in Design View, select all the text boxes in the
apart from S c h oo ln ame Detail, except the S c ho o ln am e
onto two tabbed pages, Press DELETE to delete all these boxes
keeping the address
information separate from Step 2
the contact information
Click on the D es ign tab, then drag a large
rectangle on the form, nearly filling the Detail section
Step 3

If necessary, click to display the Fields List


Add text box controls for the fields Ad dr ess1 ,
Address2 , Address3 , C oun ty and Pos tCode,
placing them on the first tabbed page
Step 4
On the second tabbed page, add more field controls, for
C on ta c tNam e and C o nta c tPho ne
Step 5
Arrange the controls neatly
Task 6 Step 1
Test the form then close it, Try out the form in Form View: add a record and give
naming it some suitable data, then edit some data values in an
f r m Sc h oo lsT ab be d existing record
Step 2
Use Sav e As on the F i le menu to save the form, giving
it the new name frmSc hoo ls Ta bb ed
Step 3
Close the form

18 IT Learning Centre
Databases: User-friendly database design

Task 7 Step 1
Create a new form for In the Navigation Pane, select the table tb lSc hoo l
schools, using the Multiple
Step 2
Items tool
On the Cr eate tab, click then choose

Step 3
A new form is created
Task 8 Step 1
In Design View, examine Switch to Design View
the tabular layout that has
been applied Step 2
Click various items on the form, in the Header and the
Detail section, to discover the way they have been set
out
Task 9 Step 1
Edit the text of the title Click in the title text box (it probably reads tblSchool)
until you see a flashing text insertion point
Step 3
Edit the text to read School Details

Task 10 Step 1
Adjust the sizes of the field Delete the S c h oo lI D label in the Header
controls
Step 2
Drag the side of the Sc ho olID text box in the Detail, to
make the box much shorter
Step 3
Drag the side of the Pos tCode text box in the Detail, to
make the box and its matching label somewhat shorter
Step 4
Make any further adjustments to size, arrangement or
formats that you wish
Task 11 Step 1
Notice that the Default If necessary, show the Property Sheet at the F o r m a t tab
V iew property of this form
has been set to Continuous
Forms
Step 2
Find the D e fa u lt V ie w property
This has been set to Continuous Forms
That means that many records will appear on the screen
together, one below the other
Task 12
In Form View, test the form
Notice the position and behaviour of the controls on this form

19 IT Learning Centre
Databases: User-friendly database design

Task 13 Step 1
Close the form, naming it Use Sav e As on the F i le menu to save the form
fr mSch oo lsC on tin uo us
Step 2
Give it the new name fr mSch oo lsC on tin u ous
Close the form
Task 14 Step 1
Look at the Relationships
diagram for this database Click on the D a tab as e T oo ls tab, to see the
One or more patients in Relationships diagram
t b lPa t ie n t are linked to
Step 2
each school in tblSc hool
Notice there is a one-to-many link between tb lPa t ient
and tb lSchoo l
This means that a number of patients may attend the
same school
Step 3

Close the Relationships diagram using

Task 15
Open f r mSch oo lsW ith Pe op le in Design View
This will be the main form (one record per school), where you will add a subform
showing the people who attend that school
Task 16 Step 1
Create a new subform Ensure there is a suitable space on the form, where the
control subform can appear

Use data from tb lPa tie nt If necessary, move some controls and stretch the width
of the form
Choose G iv e nNa me and
F a m ilyN ame fields Step 2
When defining which Click and drag a generous rectangle on the form
fields link the two forms,
The wizard starts
choose to use S c h oo lI D
Step 3
In the first part of the wizard, you choose whether to use
an existing subform which you may already have built
and saved, or to create a new subform

20 IT Learning Centre
Databases: User-friendly database design

Step 4
Choose to U s e ex is t ing T ab le s a nd Q ue r ies

Click N ex t to move on through the wizard

Step 5
In the next part, choose the table or query which
contains the records that are to be listed in the subform
– choose t b lPa t ie n t

Step 6
Select the fields which you want to appear in the
subform – choose G ive nN ame and F a m i lyN a me
Step 7
In the next part, the wizard offers any relationships
which already exist between the two tables/queries
Unless you are sure you want to define a fresh
relationship, choose the most likely definition from
those offered
Choose to show records using S c ho o lI D
T ip : if when the subform is complete it shows
completely unexpected data and relationships, it is
usually easier to delete the subform, check your data,
then re-run the wizard to create a fresh subform, and
choose carefully at this point

21 IT Learning Centre
Databases: User-friendly database design

Step 8
In the final part of the wizard, name the subform
fs ubPa tients AtSchools
Be careful to edit the suggested name to something that
conforms with the naming convention (prefix fs ub , no
spaces etc)
Click F in is h
You are still working in f r m S c ho o ls W ith P eo p le
Task 17
Look at the main form in Form View, and examine the school records to see
which people are at each school

22 IT Learning Centre
Databases: User-friendly database design

Learning Objective Seven: Automatic actions

Task 1
Continue working in Woodstock Road Dentist.accdb
When entering details of a patient who attends school, it would be convenient to
have a button that opens the form for entering school details
Task 2
Open the form frmPatientsPlain
Task 3 Step 1
Add a button to the new Switch to Design View
form, which carries out the
Step 2
single action to Open the
form frmSchoolsPlain Click and drag a button shape in a space in the
form detail
The wizard starts
Step 3
In the Categories, select F o r m Op era tio n s
In the Actions choose O p en Fo r m
Step 4
In the list of available forms, choose
frmSchoolsP lain
Step 5
Agree to O pen t he f or m a nd s how al l t he
r ecor ds
Step 6
Choose the picture offered for the button
Step 7
Accept the suggested button name and finish the
wizard
Task 4
Save the form
In Form View, click the button and see that it opens another form
Task 5 Step 1
Apply a Quick Style to the Close the Schools form
button and change the shape View the Patients form again, in Design View
Step 2

With the new button selected, click on the


F or ma t tab
Step 3
Choose a colour and appearance that you think will
look good in the form

23 IT Learning Centre
Databases: User-friendly database design

Step 4

Click and change the button into a rounded


rectangle
Step 5
Try out the button in Form View
Task 6
Close all forms, saving changes if asked
Close the dentists database, leaving Access open
Task 7
Open Inventory.accdb
Look at the Relationships diagram to discover the tables and their links
In this database, an administrator is looking after a collection of equipment, each
of which is assigned to a department
Task 8 Step 1
Look at Macros listed in the Look at the list of macros in the Navigation Pane
Navigation Pane and run
Step 2
mcrOpenFormMax
Either select mcrO pe nFo rmMax and press ENTER
or double-click the macro name
This macro will open a form, then display messages
explaining which record it is showing
Step 3
Close the form
Task 9 Step 1
Create a new macro which
opens the report Click on the Cr eate tab, to start creating a new
rptAllAssets with the filter
macro
qryMaintenancePlan in
Print Preview view Step 2
In the first ,
choose from the drop-down list the Action
O pe nRe port
In the parameters, select the report name
r p tAllAss e ts
Step 3
In the View box, select Print Prev iew
Step 4
In the Filter Name, type qry Ma in ten an ce Plan
This query has been created already (this query uses
criteria to select only some of the records)

24 IT Learning Centre
Databases: User-friendly database design

Task 10 Step 1
Include a message box with a
suitable greeting Look in the Action Catalog
Explore the way that the actions are presented in
categories
Step 2
As the next Action, choose Mess age Bo x
Step 3
In the parameters:
Give a helpful message such as This report shows
all the assets
Choose the Type Information
Give a dialog title Asset Inventory

Task 11 Step 1
Save the macro as Close the macro
mcrAssetsForMaintenan Save it, giving the name
ce mcr Asse tsF or Ma in tena nce
Run the macro using the Step 2
D a tab as e T oo ls tab

Click on the D a tab as e T oo ls tab


In the Run Macro dialog, choose
mcr Asse tsF or Ma in tena nce
Step 3
Close the report and any macro windows
Task 12 Step 1
Set the macro Open frmAllAssets in Design View
mcrGoToRecord to run
Step 2
when frmAllAssets is
opened Display the form’s properties:

click and click the form selector button (square


space where the two rulers meet)
Step 3
On the Event tab of the Property Sheet, click opposite
the O n Open event
Choose mcrG oT oRec ord
Step 4
Close the form

25 IT Learning Centre
Databases: User-friendly database design

Task 13
Run frmAllAssets and confirm that the macro has run
This macro maximizes the form, then moves immediately to the first record,
which has a Serial Number of 576345
Task 14 Step 1
Add a button on Switch to Design View
frmAllAssets to run the
macro Click and click in a space in the form
mcrChangeVisibleProper The wizard starts
ty
Step 2
Give the button text Hide A
Control Make these choices in the wizard:
In the Categories, select Misc e lla ne ous
In the Actions choose R un Macr o
In the list of macros, choose
mcrCh an geV is ib le Pr op er ty
Step 3
Type text for the button: Hide A Control
Accept the suggested button name
Task 15
Save then run the form
Click the new button and see what the macro does
Task 16
Close the form, saving changes

26 IT Learning Centre
Databases: User-friendly database design

Learning Objective Eight: Welcoming your users

Task 1
Continue work in Inventory .accdb
Task 2 Step 1
Create a new navigation form In the Cr eate tab, click
Name it frmWelc ome
Choose Ve r tic a l Ta bs , Le ft
Step 2
This creates a new navigation form
Step 3
Save this as fr mWe lc ome
Task 3 Step 1
Add a title Customer Click on the D es ign tab – this creates a
Services
new title in the Form Header
Step 2
Type Customer Services in the new title

Task 4 Step 1
On the new form, add a Confirm that you are working in Layout View
button which opens
fr m AllAss ets
Step 2
Drag the form name fr mA llAss e ts from the
Navigation Pane to the left column on the form
labelled [Add New]

Step 3
A navigation button is created
Task 5
Add further buttons to the navigation form, for opening other form(s) and
report(s)
Task 6
Save the form
View the welcome form in Form View and try out all the navigation buttons
Task 7 Step 1
Change the appearance and Select the Assets navigation button
shape of the buttons (click once, to see an orange border around the
button)
Step 2

Click on the F or ma t tab, and choose a different


Quick Style for the button

27 IT Learning Centre
Databases: User-friendly database design

Step 3

Click and change the shape to a Rounded


Rectangle
Step 4
Use the Format Painter to make all the other
navigation buttons match the one you have formatted
Task 8 Step 1
Improve the text shown on Select the Assets button if necessary
the buttons
Step 2
Click a second time on the button, to see a flashing
text insertion point
Edit the button text to say Details of equipment

Step 3
Edit the other buttons to have more familiar text
Task 9 Step 1
Improve the text shown in
the tab at the top of the Display the Property Sheet: click on the D es ign
navigation form
tab
Step 2
Use the drop-down control at the top of the Property
Sheet to display the properties of the form itself
You are working on the navigation form
Step 3
On the F or ma t tab of the Property Sheet, type
Welcome in the Caption
This Caption text replaces the form name in the tab at
the top of the form
Task 10 Step 1
Add one more button in the Switch to Design View
header, to exit the application
Step 2
In the Form Header, resize the title object to leave
some space at the top right corner
Step 3
Click to start the Command Button wizard

Step 4
Drag a button shape in the space in the Form Header
Step 5
Choose Ap p lic a tio n and then Q u it App l ica tio n
(type Goodbye or suitable text)

Step 6
Format the new command button to match the others

28 IT Learning Centre
Databases: User-friendly database design

Task 11
Save the form and try out all the buttons in Form View
Task 12 Step 1
Among the Current On the F i le menu, click
Database category of the
Access Options, set: Step 2
D isp la y F or m / Pa ge is Click C ur re nt D a ta base in the category list on the left
frmWelcome (or any other Step 3
form you would choose for Set the D isp la y F orm to be the navigation form
starting) frmWelcome
A p p lic a t ion T it le is Rapid (Note: If this form does not yet exist, you could make it
Equipment Supplies Ltd following the instructions in Error! Reference
source not found. or nominate another available
form)
Step 4
In the A p p lic a t ion T it le box, type
Rapid Equipment Supplies Ltd

Step 5
Under N av iga t io n , clear the D isp lay N av iga tio n
Pane checkbox
Step 6
Close the Options dialog
Task 13 Step 1
Close the .accdb file and Click in the F i le menu to close
re-open it to see the startup
In ven tory .acc db
options
Step 2
Open I nv e n to r y .acc db using O p en on the F i le menu
Step 3
The welcome form opens immediately, the Navigation
Pane is hidden and the alternative text appears in the
Access title bar
Task 14 Step 1
Use SHIFT to re-open the Close I n v e n to r y .acc db
file normally
Step 2
Open I nv e n to r y .acc db once again, while holding
down SHIFT
This time the welcome form does not open
automatically, and the alternative text does not appear
in the Access title bar
Task 15 Step 1
Finally, close everything Finally, close the database file and close Access
Step 2
Leave the computer at the Windows desktop

29 IT Learning Centre

Potrebbero piacerti anche