Access Manual Part 1

download Access Manual Part 1

of 35

Transcript of Access Manual Part 1

  • 8/6/2019 Access Manual Part 1

    1/35

    BUILDING APPLICATIONS WITHMICROSOFT ACCESS 2003

    PART 1CREATING THE DATABASE

    IntroductionThis document introduces techniques for building a database application using therelational database management system calledMicrosoft Access 2003 You will undertakea case study, and design concepts and implementation techniques will be introduced asyou work.

    PrerequisitesYou will need to be familiar with using a mouse, keyboard and the Windows desk top.

    Ideally you should have some prior experience ofMicrosoft Access 97, 2000, XP, or 2003.However, you will have the opportunity to work through examples to cover

    introductory topics.

    Contents

    1 Introduction 1

    2 Case Study 1

    2.1 What you need to know about cats 12.2 What you need to know about owners 22.3 Analysis 22.4 Database object naming conventions 3

    3 Creating the database 4

    4 Tables 6

    4.1 Creating a Table with Table Wizard 64.2 Modifying a Table Design 94.3 Moving around a Table 114.4 Entering Data in a Table 12

    5 Getting Started with Forms 13

    5.1 Creating a Data Entry Form with Form Wizard 135.2 Entering Data with Forms 14

    6 Relationships 15

    6.1 Types of relationships 156.2 Adding another table 156.3 Enter Cats data 17

    7 Queries 18What are Queries? 18

  • 8/6/2019 Access Manual Part 1

    2/35

    Doc. 5.115a Building Access 2003 Applications

    Building a Query to use in a Report 188 Reports 20

    8.1 What are Reports? 208.2 Building and Modifying a Report 208.3 Selecting Objects 218.4 Sorting Data in a Report 218.5 Changing Object Properties 22

    9 Implementing a new requirement 23

    9.1 The new requirement 239.2 Analysing the new requirement 239.3 Logical Design of Table Bookings 249.4 Logical Design of Form Bookings Form 269.5 Create Bookings Table 279.6 Create FormBooking 28

    9.6.1 Create a standard form 28

    9.6.2 Add a combo box for Owner's Pick List 289.7 Combo Boxes 289.8 Selecting objects 309.9 Setting the control source of a combo box 319.10 Add Text Boxes with Calculated controls 319.11 Testing the combo box 33

    About this Document Words that you type or choose are in bold type, e.g.Choose Programs from

    the Start menu. Keys that you press are shown in small capitals e.g. press ALT. Press KEY1 + KEY2 means press both keys together e.g. press CTRL + Z Press KEY1, KEY2 means press each key consecutively e.g. press A, B. General guidelines on how to perform a task are indicated by bulleted lists using

    the symbol. Note that these are nottasks for you to perform nowthey areadvice for you to follow later when you need to work things out for yourself.Exercises for you to practice as you work through the notes are labelledExercise, e.g. Exercise 1 Importing Database Objects. The steps that you

    do to complete the exercise are marked by round bullets ().

    Hints and tips are indicated by If you are not very familiar with usingcomputers then you should pay particular attention to the hints and tips. Even ifyou are fairly familiar with using a computer you should read them, as they canprovide explanations of why you do something, or they may suggest analternative way of doing things.

    ii

  • 8/6/2019 Access Manual Part 1

    3/35

    Building Access 2003 Applications Doc. 5.115a

    1 IntroductionThe aim of this document is to introduce you to some techniques for creating a userinterface for Microsoft Access 2003 applications. An application is a database (ordatabases) that the designer has organised so that the users can focus on the job athand, without needing any knowledge ofAccess. The interaction between the userand the application is known as the User Interface. Forms play a central role in theuser interface. The userdoes not need to know about the underlying tables, queries,macros and modules. However, you, as the designer will need to know about thesetopics.

    The material does not cover the topics ofmacros and writing code for Visual Basicprocedures in great detail. However, you will have an opportunity to see examples,and to compare the advantages and disadvantages of code and macros.

    Work through the notes in sequence. Read the hints and explanations before youattempt the exercises. The exercises need to be completed in the order that theyappear, as they depend on objects1 that have been created in previous exercises.

    Before you build a databaseit is essential to analyse the problem. This is true evenfor a simple database such as a list of names and addresses and becomes even moreimportant when you are designing an application based around a database. So beforeyou start to build the database you will need to read the case study notes. As youare working through the exercises you will need to refer back to the notes on therequirement.

    2 Case StudyThe owner of a boarding cattery has asked for a database to help her manage hercattery. As the cats leave it to their owners to arrange their cattery bookings, sheneeds to store information about Owners. She would also like to display informationabout the cats dietary needs. She normally feeds a different variety of food eachday, but needs to know if any cats currently in the cattery are unable to eat thatvariety, and make provision for the exceptions. So she needs to store informationabout Cats. She would also like to be able to remind owners when their cats are duefor vaccination against infectious diseases.

    2.1 What you need to know about cats All cats boarded at the cattery require an up to date vaccination certificate

    against various cat diseases. Healthy cats are fed a varied diet of white meat, red meat, fish, and dried cat

    food. Older cats may have to avoid red meat, or dried food. Some cats develop eczema if fed on fish A cat has only one (official) owner When a cat first comes to the cattery, it is given a unique Cat Identifier. The cat occupies a pen or run, which has a unique run number. The cat prefers its owner to live at a fixed address.1 Database components inAccess 2003 are referred to as objects.

    1

  • 8/6/2019 Access Manual Part 1

    4/35

    Doc. 5.115a Building Access 2003 Applications

    2.2 What you need to know about owners

    An owner may own one or more cats Some owners like their cats to occupy the same run, as it is cheaper They like to give their cats names.2.3 AnalysisThe important thing at this stage is not knowledge of computers, but anunderstanding of the problem. As this is not a course in Systems Analysis, theanalysis has been done for you, so that you can practise usingMicrosoft Access 2003straight away.

    Entity is the term used in database design for things that we need to keepinformation about. Entities in the real world map to tables in the database so we willstart with two tables in our database called Owners and Cats. TheAttributes2 of an Ownerare the contact details. We will give each owner a

    unique identifier, and store the owners first and last names. We also need theaddress, town, county, postcode, and phone number. Note that a Catis NOT anattribute of an Owner. Cats can exist independently of their Owners.

    The attributes of a Catare its Cat Identifier, name, age, sex, vaccination date, andspecial dietary needs.

    In order to identify the Relationship between a cat and its owner we will use theowner identifier as a field in the Cats table, as well as in the Owners table.

    It is good practice, when designing a database, to use unique identifiers. This is becausethere may be several people with the same name & initials. We could identify them byname and address. However, since we want to use the owners identity to link to the

    Cats table, it would mean that we had to update the Owners and the Cats tables if theowner moved address.

    Examples of unique identifiers that you will probably have come across are yourNational Insurance number or your ITS Username. These do not change however manytimes you move. As cats are even less likely to have unique names than their owners, wewill give each cat a unique Cat Identifier.

    We have identified two entities, which tells us what tables to use, and we haveidentified their attributes. Attributes map to fields in our tables. The Owners table will

    have the fields shown in Table 1, and the Cats table will have the fields shown inTable 2. We have also identified a relationship between the Cats and Owners, so wehave included the common field OwnerId in both tables. Later you will learn howthis common field can be used to link tables. Note that Identifier is usuallyabbreviated to Id when used in field names.

    A table is a structured way of representing data. Ive used Microsoft WordTable 1 andTable 2 to illustrate the structure of the two tables that we need for the Microsoft

    Access tables. The fields in Access are the column headers in the Word table. The

    2 Attribute - A quality or characteristic inherent in or ascribed to someone or something.

    (http://www.yourdictionary.com/)

    2

    http://www.yourdictionary.com/http://www.yourdictionary.com/
  • 8/6/2019 Access Manual Part 1

    5/35

    Building Access 2003 Applications Doc. 5.115a

    database table will hold data values for First name, Last Name etc., for example BillSmith. These will be rows in the table. In database terms these are called records.

    Table 1 Fields for Owners Table

    OwnerId Firstname Lastname Address City County PostCode

    PhoneNumber

    Table 2 Fields for Cats Table

    CatId OwnerId Name Age Sex VacDate DietNotes

    2.4 Database object naming conventions

    Database development includes naming object files consistently. Naming conventionsare not mandatory, but they do make your work consistent. If you plan on sharing adatabase with others, then it is a particularly good idea to use them. The usualconvention is that all objects should have a descriptive tag, placed at the start of theobject name. The most commonly used convention is the Leszynski/ReddickGuidelines for Microsoft Access. You can find out more about these at

    http://www.microsoft-accesssolutions.co.uk/naming_conv.htm

    However, the choice of naming convention is not as important as making sure thatyou do implement a naming strategy. We will use more meaningful tags for theobject names, e.g. table instead oftbl. This will allow you to familiarise yourself with

    the objects used inMicrosoft Access

    Try to use identical names for objects and field names to the ones used in the notes.Avoid spaces in names because some database sysems may not permit them. If youare consistent about spelling thenMicrosoft Office 2003 will do some of the work foryou. For example relationships between tables can be implied by using identical fieldnames in the two tables.

    3

    http://www.microsoft-accesssolutions.co.uk/naming_conv.htmhttp://www.microsoft-accesssolutions.co.uk/naming_conv.htm
  • 8/6/2019 Access Manual Part 1

    6/35

    Doc. 5.115a Building Access 2003 Applications

    3 Creating the databaseThe database file that you will now create is the containerfor the objects (tables,forms etc. that you will create.).

    Exercise 1 Create a new database

    Login to the computer and startMicrosoft Access 2003 Select Create a new file from theMicrosoft Access Getting Started pane on the

    right of the Window., as shown in Figure 1

    Figure 1 Creating A New Database

    Click on Blank Database In the File New Database dialogue boxmake sure that you have selected the My

    Documents folder on your N: drive, and replace db1.mdb in the Filenamebox with fads.mdb3. Your New Database box should look something likeFigure 2

    Click on Create

    3 The most important thing about a database is to give it a memorable, meaningful name. FADS stands

    for Feline Animals Database System.

    4

  • 8/6/2019 Access Manual Part 1

    7/35

    Building Access 2003 Applications Doc. 5.115a

    Figure 2 New Database Dialogue Box

    Now that you have created the container you can add objects to it, for exampletables, forms, queries and reprts. You do notneed to create a new database for each

    new object.

    5

  • 8/6/2019 Access Manual Part 1

    8/35

    Doc. 5.115a Building Access 2003 Applications

    4 Tables

    4.1 Creating a Table with Table Wizard

    When you create a new database the database windowlooks something like Figure 3.There are no objects in the database. Objects such as forms, reports and queries areall based on Tables, so first we must create a table. Notice thatMicrosoft Access 2003hasgreyed outthe Open and Design buttons, as the only action available to you atthis point is to create a new table.

    Tables are the foundation of your database. Without tables no other objects can exist,so you must create the tables first

    Buttons that are greyed out in Windows are not available in the current context.

    Figure 3 New Database Window

    We will use theMicrosoft Access 2003 table wizard to create the Owners table. Whenyou create a new table using table wizardyou will be shown a list of sample tables.

    Some tips on using table wizards: Choose a table that most nearly matches the entities that you have identified in

    your analysis. As Owners and Customers are likely to have a lot ofattributes incommon, for example names and addresses, the Customers table is a good placeto start. In the next exercise you will start with the Customertable & customize it

    to meet the requirement that we have identified.

    6

  • 8/6/2019 Access Manual Part 1

    9/35

    Building Access 2003 Applications Doc. 5.115a

    There are no spaces in the field names. This is because some computer systemsdo not recognise spaces. By omitting them inMicrosoft Access 2003 we will makeit easier to re-use our design on other systems if we need to in future. However,you may want to use spaces where it will make it easier for human users of thedatabase to understand what is happening, for example labels on forms and

    reports, user specifications to be agreed with your end users. All of the attributes (represented by fields) that we need appear in the Sample

    Field list, although some of the names will need to be modified. To include afield from the sample field in the New Table Field list click on >.

    If you make a mistake, click on < to remove the field. This is useful if you getfields in the wrong order. You can simply remove them and add them back in therequired order.

    Exercise 2 Create a new table

    Click on the New button in the new database window. The New Table boxappears.

    Select Table Wizard from the list ofNew Table options Click on O.K. Table Wizardwill show a list of sample tables. Click on Customers in the Sample Table list. Click on CustomerId in the Sample fields, then click on > to add it to Fields

    in My New Table. Do this for the rest of fields that we identified in section 2.(That is Firstname, Lastname, Address, City, County, Postcode, PhoneNumber)

    Use CustomerId for OwnerId, CustomerFirstName for FirstName,CustomerLastName for LastName, BillingAddress for Address andStateorProvince for County

    Click on CustomerId in Fields in my new table, then click on the RenameField button and rename the CustomerId field to OwnerId. Repeat this forCustomerFirstName etc., until all the field names match those that we identifiedin our requirement. Your Table Wizarddialogue boxshould now look likeFigure 4 (see next page)

    7

  • 8/6/2019 Access Manual Part 1

    10/35

    Doc. 5.115a Building Access 2003 Applications

    Figure 4 Table Wizard New Table

    Click on Next>. Table wizardwill ask you what you want to call the table. TypeTableOwners. Note thatMicrosoft Access 2003 also allows you to choose aPrimary Key. For this database we can letMicrosoft Access 2003 do that for us, soleave that option unchanged.

    Figure 5 Naming a table

    8

  • 8/6/2019 Access Manual Part 1

    11/35

    Building Access 2003 Applications Doc. 5.115a

    Click on Next>. Table Wizardwill ask you if you want to enter data or modifythe design. We do need to modify the design slightly, so click in the ModifyTable Design option button.

    Click on Finish>4.2 Modifying a Table DesignTable Wizardopens the table in design view, which allows you to make changes to thedesign. The design view of the Owners table looks similar to Figure 6.

    If you want to make more changes to the design at a later stage, you can go to thedesign view. You can do this by selecting the database window, selecting the table andclicking on the design view button. An alternative method, if you already have the tableopen, is to use the toolbar buttons. You will see that while we are in design view thedatasheet view button is highlighted on the table design toolbar. If we were to switch todatasheet view then the design view button would appear. You can use these buttons

    to switch between views.

    If you cannot see a button or toolbar, choose Toolbars from the Viewmenu andmake sure that the required toolbar is checked.

    Figure 6 Owners Table before modification

    Datasheet view button

    In the design viewMicrosoft Access 2003 allows you to enter and/or edit Field Names,

    Data Types, Descriptions, and Field Properties.

    9

  • 8/6/2019 Access Manual Part 1

    12/35

    Doc. 5.115a Building Access 2003 Applications

    You edit text for Field Names and Properties just as you would edit, forexample, a filename in a dialogue box. That is, you can select it with the mouseand overtype it, or you can use the cursor movement and delete keys to locateand delete characters that you do not want.

    You edit Data Types by clicking on the field and selecting a Data Type from thelist that drops down. We will look at data types in more detail when we buildother tables.

    If a Field Property is restricted to a fixed set of values, then a downward pointingarrow appears when you click in the field. You can then click on the arrow andselect a value from the list.

    Notice that OwnerID is of data type AutoNumber. Every time we enter dataabout a new owner,Microsoft Access 2003 will automatically allocate a uniqueOwneridand every record will have a unique key.

    Microsoft Access 2003 allows the database designer to set a field property input mask

    on data entry fields. Input masks help users to avoid some data entry errors, such asdropping a digit from a phone number.

    Exercise 3 Modify the Table Design

    Click in the field for PostalCode to select it. Click in the Field Properties section in the Input Maskrow. (make sure

    General tab is selected).

    Click on the build button, that is the symbol on the right of the field. Accessmay ask you if you want to save the table. Click on yes.

    When the input mask wizard starts click on PostalCode.

    Figure 7 Input Mask Wizard

    In the Try It box typeWC1E 7HX. E is not accepted.

    10

  • 8/6/2019 Access Manual Part 1

    13/35

    Building Access 2003 Applications Doc. 5.115a

    Double click on PostalCode and change >LL00 LL to Laaa 0LL (a means anoptional letter or digit). TryWC1E 7HXagain.

    Click on Finish Chose Save from the File menuIf you had finished using the table, you could close it at this stage by choosing Closefrom the File menu. However, do not close it yet, as we will enter some data indatasheet view before we look at forms to simplify data entry.

    4.3 Moving around a Table

    Before we can enter data we must leave design view, and change to a view calleddatasheet view. You can use the on-line help to find out how to move (or navigate in

    Microsoft Access 2003 jargon) between records in the datasheet.

    Exercise 4 Navigating round a table

    Click on the drop down arrow next to the View button on the toolbar. UseHover Help to locate the button. (Hint: it is near the left hand end of thetoolbar).

    Select datasheet view. The table will now look like Figure 8.

    Figure 8 Owners Table in Datasheet View

    Select Microsoft Access Help from the Help menu. Type Navigate in thebox labelled Search forthen click on thegreen button.

    In the pane labelled Search Results click on Move between records orfields, then click on Moving between records by using navigation buttonsin a datasheet or form. A diagram showing how to move around yourdatasheet appears.

    Other useful terms to search on are keyboard shortcut and input mask. When you have seen all that you want in the Help windows click the minimisebutton on the Help Topic Window, and the window will be reduced to a button

    11

  • 8/6/2019 Access Manual Part 1

    14/35

    Doc. 5.115a Building Access 2003 Applications

    on the taskbar. If you want to refer to that topic again or to go back to othertopics, click on the button to restore it.

    Close the search results pane by clicking on the X in the top right corner of thepane.

    4.4 Entering Data in a Table

    Exercise 5 Enter Data in a table

    Enter the data shown in Table 3. Type your data in the fields, using the TAB keyto move forward between fields, use Shift+TAB to move backwards.

    When you have entered the data, choose Close from the File menu.Although Microsoft Access 2003 requires that you to save designs of tables, forms, etc.

    the data that you enter is saved automatically.

    Table 3 Owners Data

    FirstName LastName Address City County PostalCode PhoneNumber

    Alice Brown 1 Oak Crescent Welwyn GardenCity

    Herts AL10 9BB 01707-765432

    Bill Smith 10 The Street Stevenage Herts SG9 4NM 01438-123456

    Zoe Smith 1 Oxford St. London WC3A 9AB 0207-1239999

    Ann Black-White 99 The Lane Hatfield Herts AL10 9JB 01707-234567

    Mary Green 77 Wood St Bennington Herts SG5 3BG 01438-876678

    12

  • 8/6/2019 Access Manual Part 1

    15/35

    Building Access 2003 Applications Doc. 5.115a

    5 Getting Started with Forms

    5.1 Creating a Data Entry Form with Form Wizard

    Later we will look at ways in which forms can include checks on the correctness ofthe data. For example, when entering cat details, we could use the Owners table tosupply a valid list of owners and OwnerIds. Here is a simple example of a form,which does not include any checks.

    Exercise 6 Create a form

    Click on the Form button in the database window. Click on the New button in the Form section of the Database Window. In the New Form dialogue box select Form wizard Select TableOwners in the Form Wizardbox. (Figure 9) Click on O.K.

    Figure 9 Form Wizard

    Form Wizardwill ask you which fields you want in your form. Click on >> toselect all fields. The available fields will move to selected fields.

    Click on Next>. Form Wizardwill ask you what layout you want for your form.Choose Columnarlayout.

    Click on Next>. Form Wizardwill ask you what style you want. Choose a style. Click on Next>. Form Wizardwill ask you what title you want. Type

    FormOwners in the title box.

    Click on Finish>. The form appears in Form View, ready for you to enter data.

    13

  • 8/6/2019 Access Manual Part 1

    16/35

    Doc. 5.115a Building Access 2003 Applications

    5.2 Entering Data with Forms

    Exercise 7 Entering Data into a Table using a Form

    Press Ctrl+shift +Plus Sign to go to a new record. Enter some more cat owners names and addresses, as shown in Table 4. Use the

    TAB key to move between fields. Close the owners form by clicking on the Close Button (see left) in the top

    right corner of the owners form.

    Open TableOwners and check that the new records have been added.Table 4 Some More Owners

    FirstName LastName Address City County PostalCode

    PhoneNumber

    Rose Flower 1 The Garden Roseville Roseshire RO5 1EE 01234 567890

    Phil Arrow 1 High Rd London N11 6YU 0208 9883210

    Note that the form is an alternative way of entering data into a table. Tables hold allthe data in Microsoft Access. When you type data in using a form Microsoft Access putsthe data into the underlying table on which the form is based. It does not put it into theform.

    14

  • 8/6/2019 Access Manual Part 1

    17/35

    Building Access 2003 Applications Doc. 5.115a

    6 Relationships

    6.1 Types of relationships

    There are three main types of relationship:

    One-to-one--One record in a table is related to only one record in anothertable.

    One-to-many--One record in a table can be related to many records in anothertable.

    Many-to-many--One record in a table can be related to one or more records inanother table, and one or more records in the second table can be related toone or more records in the first table.

    In our examples we will use one to many. One-to-one relationships can often be

    resolved by using one table. Many-to-Many usually require the introduction of athird table as a link between the other two enities. For more information onrelationships you should refer to a suitable text book on database design (e.g.Domanski and Irvine see Part 2, Appendix A).

    6.2 Adding another table

    We now need to add another table, to represent the entity Cats. As the Table Wizarddid not seem to have any suitable sample tables, we need to design this tableourselves. We need to specify the Field Names, Data types, and FieldProperties. Thefield names are the same as the attributes that we identified in section 2.3, that isCatId, OwnerId, Name, Age, Sex, VacDate, DietNotes.

    We can also use the field names for our captions, because we chose easilyrecognisable names for our fields. (We abbreviated some of them so that they will fitbetter on screens/A4 pages) We will introduce some new data types and fieldproperties. The CatIdis anAutonumberin this table, because we wantAccess to automatically

    allocate a new Cat Identifier to each new cat. The CatIdis known as primary keybecause it uniquely identifies a record in the table.

    The OwnerIdis given a data type ofNumber, and Field Size Long Integer. This isimportant because we want to be able to link cats to their owners. OwnerId inthe Owners Table identifies owners, which is of typeAutonumber. If we want tolink the two tables, then the fields in other tables that are to be linked to

    Autonumbermust be Long Integer Numbers. The OwnerIdis known as a foreign keybecause it is the primary keyfrom a different table.

    Age is a number. We can reduce the amount of space needed to store this field bygiving the field size the property byte. This allows us to store numbers up to 255,and since most cats do not live beyond 20 it will be more than adequate.

    Sexis a text field. There is a validation ruleIn ("M","F"). This means that valuesentered in this field must be in the set M, F. Since this is only one letter, the fieldsize can be set to 1. (The default value for Text fields is 50.)

    VacDate is of type Date/Time. RunNo is a positive numberwith field size Byte.Access automatically sets the defaultvalue to 0. We will make use of this feature later when we build a query.

    15

  • 8/6/2019 Access Manual Part 1

    18/35

    Doc. 5.115a Building Access 2003 Applications

    DietNotes is aMemo field. Since text fields can be up to 255 characters long, atext field would probably be adequate in this case, but we will use a memo fieldto show you that it is available.

    Some keyboard short cuts (see online help for more): You can use the TAB key to move between Field Name and Data Type columns. You can use the F6 key to move between the Field Name/Data Type section and

    the Field Properties section. You can use ALT + down arrow () to drop down a list. Use the arrow keys to

    move up and down the list, and press ENTER to make the selection.

    Exercise 8 Create a new table in Design View

    Click on the New button in the Tables section of the database window. In the New Table window click on Design View, then click on O.K. Enter the Field names and Data types shown in Figure 10.

    Figure 10 Cats Table Design View

    Captions are set automatically to the field name unless you change them.

    In the Field Properties box change the properties as follows:For the OwnerId field set field size to Long IntegerFor the Age field set the field size to ByteFor the Sex field set the field size to 1 and the validation rule to In (M,F)For the RunNo field set the field size to Byte.

    The Field Names and Data Types should now appear as in Figure 10. Save the tableas TableCats.Microsoft Access2000 will ask you if you want it to select yourprimary key. Select Yes

    16

  • 8/6/2019 Access Manual Part 1

    19/35

    Building Access 2003 Applications Doc. 5.115a

    The definition of primary key is " one or more fields whose value or values uniquelyidentify each record in a table. In a relationship, a primary key is used to refer tospecific records in one table from another table. A primary key is called a foreign keywhen it is referred to from another table."

    6.3 Enter Cats data

    Exercise 9 Enter Data in a table

    Use the form wizardto create a columnar autoform based on TableCats calledFormCats and use it to enter the data shown in Table 5 into TableCats.

    Close the table and the form

    Your Autonumbers may not match mine exactly. If, for example, you make a mistake

    when entering data and you have to delete a record Microsoft Access 2003 will removethat autonumber as well. An autonumber is never re-used so if you delete one it is gonefor good. As Ownerid's were automatically generated you may find yours are slightlydifferent to mine. Make sure that you use your own.

    Table 5 Cats Data

    CatId Ownerid Name Age Sex VacDate RunNo DietNotes

    1 1 Tigga 10 m 16/08/04 62 2 Samantha 3 f 05/09/04 1 No Fish

    3 2 Arabella 3 f 05/09/04 1 No Fish

    4 3 Tom 1 m 31/07/03 0

    5 4 Blackie 4 m 01/01/04 0

    6 5 Ginger 7 m 31/12/04 2 No Red Meat

    17

  • 8/6/2019 Access Manual Part 1

    20/35

    Doc. 5.115a Building Access 2003 Applications

    7 Queries

    What are Queries?

    Another class of database object is the Query. You use queries to view, change, and

    analyze data in different ways. You can also use them as the source of records forforms and reports. The next example is called a Select Querybecause we areselecting fields and records from the database.

    The steps in designing a query are: Say what type of query you want to design. Add the tables that contain the data. Add the fields which contain the data Add criteria that you want to use. Criteria are instructions that you use to tell

    Microsoft Access which records to display.

    Building a Query to use in a Report

    We need to create a report of the dietary needs of the cats that are currentlyoccupying runs. We could simply build the report based on TableCats. The catterystaff could read from the report which cats were in runs (i.e. RunNo > 0). However,as cats normally spend most of their time at home with their owners, there wouldbe more cats NOT in runs than cats in runs. The report would contain muchunneeded information. This is confusing and could lead to mistakes.

    Include the criteria in the design onlyif it is something that always takes the samevalue. That is true in this case, because a run number of 0 indicates that the cat is

    not currently in the cattery. When a cat comes to the cattery, RunNo is updated inthe cats table. When it leaves, the RunNo is again updated, this time it is given avalue 0. The criteria that we want to use in this query remain constant (RunNo > 0).Later we will used queries that use variable values as criteria, for example a valuechosen from a list.

    The Query By Example (QBE) grid is a graphical interface for creating queries. For morecomplex queries you can use Structured Query Language (SQL). For an SQL tutorial tryhttp://sqlzoo.net/

    Exercise 10 Create a query with constant criteria

    In the database window click on the Querytab, then click on New. In the New Querybox click on Simple Query Wizard, click on OK.. In the Simple Query Wizardbox drop down the list ofTables/Queries and

    choose TableCats.

    In theAvailable Fields Listchoose Name, and click on > to move it to the SelectedFieldsList. Repeat this for Age, Sex, RunNo, DietNotes. Click on Next>.

    Make sure that Detail is selected, and click on Next> Give your query the title QueryCatsInRuns. Make sure that Modify Query

    Design is selected and then click on Finish.

    The query should appear in Design View. If not, then switch to Design Viewbyclicking on the Viewbutton on the tool bar.

    18

    http://sqlzoo.net/http://sqlzoo.net/
  • 8/6/2019 Access Manual Part 1

    21/35

    Building Access 2003 Applications Doc. 5.115a

    In the QBE grid, click in the criteriarowin the RunNocolumn. Type > 0 as thecriteria for RunNo. Note that the expression > 0 is not enclosed in [] becausewe do not wantAccess to prompt for it when we run the query. Your designview should look like Figure 11.

    Figure 11 QBE Grid for CatsInRuns query

    From the File menu save your query as QueryCatsInRuns There is a short cut button for running the query on the query design toolbar.

    Use hoverhelp to locate it. (Hint - it looks like !). Click on the Run Query button.

    Your Query result should look like Figure 12. Close the query

    Figure 12 CatsInRuns Query

    19

  • 8/6/2019 Access Manual Part 1

    22/35

    Doc. 5.115a Building Access 2003 Applications

    8 Reports

    8.1 What are Reports?

    The next class of object that we will build is a Report. Reporting is the way in whichyou choose to present the contents of your database as printed pages. Reports enable you to select which fields will be printed out and what data

    should be included. Reports can also summarise data in various ways. Microsoft Access gives you the opportunity to design the layout of a particular

    report including the position of headings, field names, the data itself along withgraphics such as pictures and logos.

    Reports can take their data from tables, or existing queries or queries can becreated especially for the report.

    In order to create a report that uses fields from more than one table a queryneeds to be created which contains all the necessary fields.

    You can also useMicrosoft Word Mail Merge to customise your own reports,using data from aMicrosoft Access database for the merge fields.

    8.2 Building and Modifying a Report

    You can use QueryCatsInRuns as the basis for your report. Although the reportgenerated by Report Wizardwill not be exactly as we want it, we will use the ReportWizard to build the report, and then we will modify the design.

    Exercise 11 Building a report

    In the database window click on the Reports button, then click on New In the New Reportbox choose Auto Report Tabularin the report type box.

    Choose QueryCatsInRuns in the table/query list. Click on O.K.

    The report appears in print preview. Click on design view button on the toolbar. The report will appear as in Figure 13. Save your report asReportCatsInRuns

    Figure 13 CatsInRuns Design View

    20

  • 8/6/2019 Access Manual Part 1

    23/35

    Building Access 2003 Applications Doc. 5.115a

    8.3 Selecting Objects

    Before you can do anything with an object you have to selectit. You select an objectby clicking on it when you are in design view. On Forms and Reports you can make

    Multiple Selection, that is you can select several objects at once.

    To select several objects located next to each other , hold down the shiftkey and clickon each object in turn.

    To select several objects that are not next to each other hold down the ctrlkey andclick on each object in turn

    An object can have various properties Events, Data, etc.

    Properties vary for different object, i.e. not all objects will have all properties.

    8.4 Sorting Data in a Report

    When you have selected objects then you can perform operations on them, such assortingdata, or you can change their properties such as fonts, colours, alignment. Thedata in TableCats on which we based the QueryCatsInRuns is in the order thatthe cats are added to the database. However, it would be more useful ifReportCatsInRuns was sorted according to RunNo, as the runs with lowestnumbers are dealt with first.

    Exercise 12 Sorting Data in a report

    Make sure that ReportCatsInRuns is open in design view. Click on RunNo in the detail section. (See Figure 14)

    Figure 14 Selected Object

    Click on the Sorting and Grouping button on the toolbar. The Sorting andGroupingwindow appears

    In the Sorting and Grouping Windowchoose RunNo from the Field/Expressioncolumn. (use the to drop down the list of fields).

    Click on the Close Window button (r) in the Sorting and Grouping Windowtoclose it. (Be careful to close only the window, and not the whole report)

    Click on the Print Preview button on the toolbar to see a list of cats in runs,sorted in ascending order of run number.

    21

  • 8/6/2019 Access Manual Part 1

    24/35

    Doc. 5.115a Building Access 2003 Applications

    8.5 Changing Object Properties

    Another change that would improve the appearance is to changethe alignment of the Name, Age, and Sex fields. The alignment is

    a formatproperty of these objects. All objects have properties.

    If you cannot see the properties window then click the rightmouse button. Choose Properties from on the menu thatdrops down. (See left)

    To change a property click in the field. Some properties willdisplay a drop down arrow, meaning that you can choose aproperty from a menu. For other properties you will need totype a value.

    Exercise 13 Changing Object Properties

    Make sure that the report is in Design View. In the detail section of the reportselect Age, Sex, RunNo (see Figure 15)

    Figure 15 Selected Details

    In the properties window set the text align property (under formattab) for theselected objects to Centre (Figure 16).

    Repeat this for the page header section Save the report, preview it, and close it

    Figure 16 Properties Window

    22

  • 8/6/2019 Access Manual Part 1

    25/35

    Building Access 2003 Applications Doc. 5.115a

    9 Implementing a new requirementDatabase analysis is done in two parts, the logical design and the physical design. Asoften happens, the customer did not specify the full requirement at the start of theproject. Ms. Twitchett is pleased with the database, and has identified a newrequirement. She would now like to use it to keep records of bookings made byowners. The first step is to do an analysis of our data structures (tables) and toidentify any additional data database objects that we need to create.

    9.1 The new requirement

    Owners may book more than one visit in advance. Ms Twitchett would like to see: Who made the booking When the cat or cats are due to arrive at the cattery How many days the cats will board for How many cats are to be boarded

    How many runs are needed The kennelling charge, i.e. use of run and food Heating charge is an optional extra. All cats need it in winter and some older

    cats may need it at other times. Insurance charge is essential. Total charge for visit.Daily Rates are as follows:

    Kennelling charge = 2 per run + 2 per cat, i.e. daily rate is calculated by(2*No. of Runs + 2*No of Cats) where '*' is a multiplication symbol.Heating rate = 50p per run

    Insurance rate = 10p per catRates may vary with time.

    9.2 Analysing the new requirement

    First of all let us look at some questions and answers that we need before weattempt to create new objects.

    Can I generate the report using the information that is already in thedatabase?No, there is no information about bookings in either the Owners table or the catstable.

    If not, what further information do I need to store?You need to store the booking details, i.e. date, number of nights, number of cats,number of runs, and daily rates.

    Could I store it by adding attributes (fields) to the existing entities(tables)?As it is the owners who make the bookings for the cats, you might be tempted toadd some new fields to the Owners table.

    Assuming this to be done, could it lead to future problems?

    23

  • 8/6/2019 Access Manual Part 1

    26/35

    Doc. 5.115a Building Access 2003 Applications

    Yes! As there is only one record for each owner, you would only be able to storeinformation about the latest booking. This would not allow owners to book morethan one visit in advance.

    If I decide to add new tables what entities are they representing?

    Entities represent things. You have seen examples of entities that representedgroups of people (Customers, Owners), and of things that are at the core of thebusiness (Cats). A manufacturing or retail business might have an entity for Products.Entities can also represent pieces of paper such as Orders. Similarly in the catterybusiness you can have an entity that represents Bookings.

    If I decide to add new tables what are their relationships with othertables?The relationship is between the owner and the booking, notbetween the cat and thebooking. An owner may make one or more bookings. Each booking is made by one,and only one owner. In database design terminology, this is a one to many

    relationship.

    What should be the primary key of any new tables?The primary key uniquely identifies the record. We have seen how easy it is to get

    Access to generate a unique primary key for each record, so we can letAccessgenerate a unique Booking Number.

    What foreign keys would I need to include as attributes of any the newtables?The relationship is with the owners table, so you should include the foreign key

    OwnerId.

    The above analysis suggests that two new objects are required. As none of theexisting tables will provide all the information that we need we need to add a tableobject TableBookings, that will hold data about the bookings. We also need a formobject FormBookings that will allow us to enter data into the table.

    The data type determines how much internal storage is required for the data. To findout about the various data types use Help, type 'Data types, described' in the searchbox.

    9.3 Logical Design of Table BookingsNow that we have identified the need for a table Bookings let us look at the fieldsthat we need in the table, and compare them with the requirement. As with all tableswe need a unique identifier. Let us call it BookingIdand have

    Microsoft Access 2003 allocate it automatically. This will be of type autonumber. We need to identifywho made the booking. We already have a means of

    doing this as we have the Ownerid. Just as we used the Owneridas a foreign key toassociate a cat with an owner we can use the Owneridto associate a booking withan owner. We know that this needs to be of type long integer in order to workwith the autonumber Owneridfield in the Owners table.

    We need to recordwhen the cats are due to arrive at the cattery. Let uscall this field CatsInDate. This is of type date.

    24

  • 8/6/2019 Access Manual Part 1

    27/35

    Building Access 2003 Applications Doc. 5.115a

    We need to record how many days the cats will board for. Let us call thisfield NoOfDays. A field of type integer will allow us to store numbers as large as32,767. This would allow us to board a cat for 32767/365 years, i.e. 89 years,which is longer than the lifespan of the average cat. So we can save space in ourdatabase by storing this field as type integer rather than long integer. However

    we shouldn't try to save too much space by going for the next size down which isbyte data type. This would only allow a cat to stay for 255 days, probably enoughfor most cat owners, but we'll play safe.

    We need to record how many cats are to be boarded. Let us call this fieldNoofCats. Data type byte will allow up to 255 cats to be boarded. Ms Twitchettprides herself on individual service to the cats in her care and wouldn't dream oftaking in that number of boarders. So type byte is more than adequate.

    We need to record how many runs are needed. Let us call this NoOfRuns.Again type byte is adequate for the size of the business.

    We need to know the kennelling charge. This is something that can becalculated if we know the number of runs, the number of cats, the number of

    days and the daily rates per run and per cat so there is no need to store it.However, we do know that rates can vary so it would not be a good idea to useconstant rates in the calculations. Instead let us store two fields RunRate andCatRate, both of type currency. We can then enter the current rate when thebooking is taken and calculate kennelling rate from the following expression.Note the use of * as the multiplication symbol, and brackets to group items.

    ([RunRate]*[NoOfRuns]+[CatRate]*[NoOfCats])*[NoOfDays]

    We need to know the heating charge. This is optional. We need to store theHeatRate which is of data type currency. We can use IIf, which is a built inMicrosoft Access function that returns one of two parts, depending on theevaluation of an expression.

    Syntax IIf(expr, truepart, falsepart)

    Named arguments:

    expr(Required). Expression you want to evaluate.truepart(Required). Value or expression returned ifexpris True.falsepart(Required). Value or expression returned ifexpris False.

    The expression to use isIIf ( [Heating] , [HeatRate] * [NoOfRuns] * [NoOfDays] , 0)

    We need to know the Insurance charge. This is also easily calculated if weknow the rate, so let us have a field InsRate of data type currency. We can thencalculate the charge from the expression

    [InsRate]*[NoOfCats]*[NoOfDays]

    Note the syntax for the calculated expressions.o Round brackets () are used to group items together and to order precedence

    in the evaluations. For exampleMicrosoft Access 2003 will calculate the

    25

  • 8/6/2019 Access Manual Part 1

    28/35

    Doc. 5.115a Building Access 2003 Applications

    expression [RunRate]*[NoOfRuns]+[CatRate]*[NoOfCats] and then multiply theresult by [NoOfDays]

    o Field Names are delimited by square brackets[ ]o The arithmetic operators are Multiplication (*), Division (/), Addition (+),

    Subtraction (-)

    Before you create the table, we will look at the logical design ofFormBookings tosee what objects we need on the form. By doing the logical design of this form(which provides the inputs and outputs for TableBookings) we will be doing acheck on the table design, which may help us to spot any logical errors in the tablestructure.

    9.4 Logical Design of Form Bookings Form

    You have created a form FormOwners based on the underlying tableTableOwners. Similarly FormBooking is based on the underlying tableTableBookings. It needs the following objects

    BookingNo allows us to see the unique identifierallocated to the booking. MsTwitchett can, if she wishes, inform the owner of this number. This will beimplemented as a text box object. The place from where it gets the data (knownas the control source) is the BookingNo field in the underlying table Bookings.

    OwnerIdallows us to recordwhich owner made the booking. We willintroduce an object type known as a combo boxthat will allow us to generate adrop down menu (called a pick listinAccess jargon) of owner's names

    CatsinDate allows us to recordwhen the cats are due to arrive at thecattery. A textbox object with control source CatsInDate.

    NoOfDays allows us to record how many days the cats will board for. Atextbox object with control source NoOfDays NoOfCats allows us to record how many cats are to be boarded. A textboxobject with control source NoOfCats

    NoOfRuns allows us to record how many runs are needed. A textbox objectwith control source NoOfRuns

    Heatingallows us to recordwhether heating is required. A textbox objectwith control source Heating

    RunRate allows us to record the current daily charge per run. A textboxobject with control source RunRate

    CatRate allows us to record the current daily charge per cat. A textboxobject with control source CatRate

    HeatRate allows us to record the current daily charge for heating. Atextbox object with control source HeatRate InsRate allows us to record the current daily charge for insurance. A

    textbox object with control source InsRate A text box KennelCostdisplays the calculated kennelling charge. A text box HeatingCostdisplays the calculated heating cost. A text box InsuranceCostdisplays the calculated Insurance Cost. A text box TotalCostdisplays the calculated total cost.You should now compare the proposed design with the new requirement, toconfirm that we have got all the required information.

    26

  • 8/6/2019 Access Manual Part 1

    29/35

    Building Access 2003 Applications Doc. 5.115a

    9.5 Create Bookings Table

    You already know how to create a new table in design view, because you createdTableCats (Section 6.2). Use the field names as captions. Table 6 summarises theinformation that you need in order to create the table.

    Table 6 Bookings Table

    FieldName DataType FieldSize

    BookingNo Autonumber

    OwnerId Number Long Integer

    CatsInDate Date/Time

    NoOfDays Number Integer

    NoOfCats Number Byte

    NoOfRuns Number Byte

    Heating Yes/No

    RunRate Currency

    CatRate Currency

    HeatRate Currency

    InsRate Currency

    Exercise 14 Create the Bookings Table

    Create a new table called Bookings with the field names and data types given inTable 6. Note that there are no spaces in the field names.

    In datasheet view enter the sample data shown in Table 7 and close the table.Table 7 does not show the BookingId asMicrosoft Access will insert this for you.

    Table 7 Booking Data

    OwnerId

    Cats InDate

    No ofDays

    No ofCats

    No ofRuns

    Heating RunRate

    Cat Rate HeatRate

    Ins Rate

    7 05/04/04 3 2 1 Yes 2.00 2.00 0.50 0.102 03/03/04 9 2 1 Yes 2.00 2.00 0.50 0.106 03/03/04 15 1 1 No 2.00 2.00 0.50 0.102 26/08/03 3 2 1 Yes 2.00 2.00 0.50 0.109 03/02/04 10 2 1 Yes 2.00 2.00 0.50 0.10

    4 31/01/04 3 1 1 Yes 2.00 2.00 0.50 0.106 03/03/04 3 1 1 Yes 2.00 2.00 0.50 0.10

    Yes/No fields such as heating may be displayed as check boxes, ticked for Yes, clearfor No. When entering data you can toggle between ticked and clear by pressing thespace bar. You can change this setting by going to design view in your table. In theField Properties for the field click in the Lookup tab and chose the DisplayControl property that you want.

    27

  • 8/6/2019 Access Manual Part 1

    30/35

    Doc. 5.115a Building Access 2003 Applications

    9.6 Create FormBooking

    9.6.1 Create a standard form

    The first step is to create a standard form based on TableBookings. You can thenadd additional objects. If you cannot remember how to use the form wizardto create

    a standard form please refer to Exercise 6. When you use Form Wizardyou areasked to choose the table or query from where the form object's data will come.You are also asked to choose which fields you want on your form. Form Wizardthencreates text boxes on the form that use these fields as their control source. Referback to the section on logical design of the form to identify the fields that you need.

    Exercise 15 Create a standard form

    Create a columnar form called Formbookings, based on TableBookings. Go to design view.

    9.6.2 Add a combo box for Owner's Pick List

    9.7 Combo Boxes

    You can use a Combo Boxon a form to locate a record in a table. A Combo Boxis acontrol, similar to a list box and a text box combined, in which you enter a value orselect an item from a list. One example of a List Boxthat Windows users should befamiliar with is the Look In box on the Insert File dialogue box in Word forWindows and other Windows applications. You use the drop down arrow to display

    the list in a combo box,just as you do in a List box. If the box is not big enough todisplay the whole list, scroll arrows appear so that you can scroll up and down thelist just as you would in a document window.

    The existing objects almost fill the form so you'll need to create some space for thenew objects. We won't worry too much about the appearance of the form at thisstage. Later we will look at some techniques for improving the appearance of a form.

    28

  • 8/6/2019 Access Manual Part 1

    31/35

    Building Access 2003 Applications Doc. 5.115a

    Exercise 16 Create a Combo box

    Form Wizardhas created a text boxfor Ownerid. However, we are going tocreate a combo boxto allow us to select an owner, so you can select theOwnerid box and delete it.

    If you need more space to add new objects then, in Design View, resize theFormBookings by dragging the border. Then drag the detail section (Figure 17)Figure 17 Resize the form

    Drag thedetail

    section

    Drag the

    border

    If you cannot see the toolbox (see left)click on toolbox on the Viewmenu. As withother toolbars, Access provides hover help to show you what the buttons on the toolboxare for

    On the toolbox click the combo box button Draw a box in the blank space created when you resized the form. Combo box Wizardstarts. You want to look up the values for the box, so make

    sure that this option is selected, and click on Next>.

    Select the Tables option, select TableOwners, and click on Next>. Select Ownerid, Firstname, Lastname by clicking on >, and click on Next>. Select sort on Last Name in ascending order then click on Next> Uncheck the hide key column box , adjust the column widths by dragging the

    column headers so that each column is about 0.5 inches wide, and click onNext>.

    Select OwnerId as the field that identifies the row, and click on Next>. Make sure that the Remember Value option is selected, and click on Next>. Change the label to Owner, and click on Finish

    29

  • 8/6/2019 Access Manual Part 1

    32/35

    Doc. 5.115a Building Access 2003 Applications

    Microsoft Access will create a combo box that looks like Figure 18. You can select thebox, as explained in the following section , and drag to move or resize thecomponents.

    Figure 18 Unbound combo box

    9.8 Selecting objects

    To select a combo box control click on the combo box. When you select thebox it displays a move handle and sizing handles. The attached label has only amove handle (Figure 19).

    Figure 19 Combo Box Selected

    To select the attached label click on the label. When you select the label itdisplays a move handle and sizing handles. The box has only a move handle(Figure 20)

    Figure 20 Attached Label Selected

    To select the combo box andthe attached label click on the box, hold down theshift key, and click on the label. Then click on the box. Both box and label willdisplay the move handle and the sizing handles (Figure 21)

    Figure 21 Boxes and Label Selected

    When you move a box the label moves with it. You can use the same techniques for resizing Text Boxes and other objects.

    30

  • 8/6/2019 Access Manual Part 1

    33/35

    Building Access 2003 Applications Doc. 5.115a

    9.9 Setting the control source of a combo box

    The box that you created is called an unboundcombo box. If you wanted to use thevalue selected in the combo box to determine the contents of another control orcontrols, you would use an unbound combo box. For example, you might want to

    create a combo box that you could use to find a related record on a form. Or youmight want to create a combo box that you use to filter the records in anothercombo box. However, in this case you want to use the combo box to store thevalue of OwnerId that you select from the list. Therefore the combo box must bebound to the OwnerId field. The OwnerId is the Control Source.

    In the next exercise you will use the properties box to set the control source value.Please refer to section 8.5 for instructions on setting object properties.

    Exercise 17 Set the Control Property

    Click on the combo box object and make sure the properties window isdisplayed.

    In the properties window click on the Data tab In the Control Source box select OwnerId. Your combo box should now

    look like Figure 22

    Figure 22 Bound Combo Box

    Click on the All tab ans set the Name property to FieldOwnersList9.10 Add Text Boxes with Calculated controls

    Exercise 18 Create the text box

    Make sure that your form is open in design view. On the toolbox click the textbox button

    Draw a box in the blank space created when you resized the form. The box willhave two parts, the box and the label, as in Figure 23

    Figure 23 Text Box

    Click the label. The properties window will be labelled something like label:label32 (your label will probably have a different number to 32 in my example).

    Set the name property to LabelKennelCost Set the caption property to Kennel Cost Click outside the property window and you will see that the label has changed.

    31

  • 8/6/2019 Access Manual Part 1

    34/35

    Doc. 5.115a Building Access 2003 Applications

    Click on the label to select it. Move the mouse pointer to the border of the boxuntil it turns into a two-ended arrow. Drag the border until you can see all thelabel text.

    Click the text box. The properties window should now be labelled somethinglike text box: text31

    Set the name property to FieldKennelCostIn the next exercise you will use expression builderto build the expression that isused to calculate the kennel cost. You can type expressions in, but using theexpression builder means that you can only select objects that exist, and it reducesthe chances of errors through mis-typing.

    Exercise 19 Build an expression for FieldKennelCost

    Click on the data tab and then click on expression builder () in the ControlSource field in the properties window. The expression builder window willopen (Figure 24)

    Figure 24 Expression Builder

    Click on = and ( so that they appear in the box at the top of the window. Double click on RunRate in the middle column (scroll if you cannot see it).

    Microsoft Access will add [ ] round the object name.

    Continue adding operators (single click) and field names (double click) until youhave built the expression=([RunRate]*[NoOfRuns]+[CatRate]*[NoOfCats])*[NoOfDays]

    Click on OKto close the expression builder. Set the format property to Currency

    32

  • 8/6/2019 Access Manual Part 1

    35/35

    Building Access 2003 Applications Doc. 5.115a

    Exercise 20 Adding your own calculated controls

    Add your own text box objects for Heating Cost, Insurance Costand Total Cost,using the expressions given in section 9.4

    You will need to set the name properties of the text box objects so that they willappear in the list of objects available on FormBookings

    9.11 Testing the combo box

    When you open the form in design view you are positioned at the first record and youwill need to select the 'new record' navigation button to go to a new record. Later wewill learn how to use an event procedure to position the form at a new record when itis opened.

    Exercise 21 Test the combo box In Formbookings switch to form view. Click on the new record button to go to a new record or press ctrl and + keys

    together.

    Click on the downward pointing arrow on the right of the box labelled Owners.Select Bill Smith from the list that is displayed. Your form should looksomething like Figure 25

    Figure 25 Select from Owners list

    Book Bill's 2 cats in for 2 days, arriving on 5/4/05. They will share a run, and as itis rather chilly in April they would like heating. Use the current rates, whichwere specified with the additional requirement.

    Open the table Bookings and check that the data has been correctly entered asthe last record.