Access 2007 Overview

Similar documents
Microsoft Access Basics

Microsoft Access 2007 Module 1

Database File. Table. Field. Datatype. Value. Department of Computer and Mathematical Sciences

Microsoft Access 2010 Part 1: Introduction to Access

Use Find & Replace Commands under Home tab to search and replace data.

Introduction to Microsoft Access 2013

Microsoft Access Introduction

Introduction to Microsoft Access 2010

Chapter 5. Microsoft Access

Creating and Using Databases with Microsoft Access

Consider the possible problems with storing the following data in a spreadsheet:

User Services. Microsoft Access 2003 II. Use the new Microsoft

IN THIS PROJECT, YOU LEARN HOW TO

Planning and Creating a Custom Database

MICROSOFT ACCESS 2003 TUTORIAL

Microsoft Access 2007 Introduction

INTRODUCTION TO MICROSOFT ACCESS Tables, Queries, Forms & Reports

Creating a Database in Access

Microsoft Using an Existing Database Amarillo College Revision Date: July 30, 2008

Reduced Quality Sample

Introduction to Microsoft Access 2003

A database is a collection of data organised in a manner that allows access, retrieval, and use of that data.

Learning Services IT Guide. Access 2013

Microsoft Access 2003 Module 1

Tutorial 3. Maintaining and Querying a Database

Microsoft Office 2010

MS Access. Microsoft Access is a relational database management system for windows. Using this package, following tasks can be performed.

Simple Invoicing Desktop Database with MS Access c 2015 by David W. Gerbing School of Business Administration Portland State University

User Services. Intermediate Microsoft Access. Use the new Microsoft Access. Getting Help. Instructors OBJECTIVES. July 2009

Ken Goldberg Database Lab Notes. There are three types of relationships: One-to-One (1:1) One-to-Many (1:N) Many-to-Many (M:N).

Microsoft Office Access 2007 Basics

Importing Contacts to Outlook

Microsoft Access 2007

Microsoft Access 2010 handout

Table and field properties Tables and fields also have properties that you can set to control their characteristics or behavior.

Getting Started with Access 2007

Creating tables in Microsoft Access 2007

MS Access Lab 2. Topic: Tables

Microsoft Office 2010

A Basic introduction to Microsoft Access

Introduction to Microsoft Office Access 2010

Access Creating Databases - Fundamentals

Microsoft Access 2010

Topic: Relationships in ER Diagram and Relationships in MS Access

Microsoft Access 3: Understanding and Creating Queries

Creating and Using Forms in SharePoint

Microsoft Access 2010 Overview of Basics

Using Microsoft Access Databases

What is a database? The parts of an Access database

Filter by Selection button. Displays records by degree to which they match the selected record. Click to view advanced filtering options

PROJECT ON MICROSOFT ACCESS (HOME TAB AND EXTERNAL DATA TAB) SUBMITTED BY: SUBMITTED TO: NAME: ROLL NO: REGN NO: BATCH:

Microsoft Access Part I (Database Design Basics) ShortCourse Handout

Create a New Database in Access 2010

Access 2010 Intermediate Skills

Lesson 07: MS ACCESS - Handout. Introduction to database (30 mins)

Advanced Database Concepts Using Microsoft Access


- Suresh Khanal. Microsoft Excel Short Questions and Answers 1

Microsoft Access 2000

MICROSOFT OFFICE ACCESS NEW FEATURES

Microsoft Access 2010: Basics & Database Fundamentals

Introduction to Microsoft Access 2007

Access Queries (Office 2003)

MICROSOFT ACCESS TABLES

Introduction to Microsoft Access

Information Technology Services Kennesaw State University

To determine the fields in a table decide what you need to know about the subject. Here are a few tips:

A Guide to Access 2007

Customized Reports using Microsoft Access 2010

warpct.com MS Access 2010 Workbook courseware by WARP! Computer Training

Beginning Microsoft Access

Search help. More on Office.com: images templates

Access I Tables, Queries, Forms, Reports. Lourdes Day, Technology Specialist, FDLRS Sunrise

Creating Tables ACCESS. Normalisation Techniques

Produced by Flinders University Centre for Educational ICT. PivotTables Excel 2010

Introduction to Microsoft Access XP

Excel Database Management Microsoft Excel 2003

Microsoft Query, the helper application included with Microsoft Office, allows

Structure a Database. Key Concepts LESSON. Access 380. Lesson 2: Structure a Database. Standards

Section DB DATABASE - Microsoft Access

Check out our website!

Sample- for evaluation purposes only! Advanced Excel. TeachUcomp, Inc. A Presentation of TeachUcomp Incorporated. Copyright TeachUcomp, Inc.

BusinessObjects: General Report Writing for Version 5

General User/Technical Guide for Microsoft Access

Lab 9 Access PreLab Copy the prelab folder, Lab09 PreLab9_Access_intro

ECDL. European Computer Driving Licence. Database Software BCS ITQ Level 1. Syllabus Version 1.0

In this session, we will explain some of the basics of word processing. 1. Start Microsoft Word 11. Edit the Document cut & move

Access Part 2 - Design

Microsoft Word 2010 Mail Merge (Level 3)

Lab 2: MS ACCESS Tables

SHAREPOINT 2010 FOUNDATION FOR END USERS

Access Queries

BID2WIN Workshop. Advanced Report Writing

Advanced Excel 10/20/2011 1

How To Create A Powerpoint Intelligence Report In A Pivot Table In A Powerpoints.Com

Microsoft Excel 2007 Consolidate Data & Analyze with Pivot Table Windows XP

Using Microsoft Access

Transcription:

Overview Computer Training Centre tcentre@ucc.ie 4903749/3751/3752

Contents Introduction... 4 What is a Database?... 4 Benefits of Using a Database... 4 Microsoft Access Description... 4 Elements of an Access Database... 5 How the Information is Stored... 6 Getting Started... 7 Opening Access 2007... 7 Meet the new look Access 2007 Window... 9 The Office Button... 10 Introducing the Ribbon Bar... 10 The Quick Access Toolbar... 11 Customizing your quick access toolbar... 11 DIALOG BOX LAUNCHER... 12 Tables... 13 Creating a Table in Design View... 14 Table Design View... 15 Table Datasheet View... 15 Easy data entry... 15 Creating a Table... 16 The Primary Key... 19 To Select the Primary Key... 19 Relationships... 21 Queries... 26 To Create a Query:... 26 Query Number 1... 27 Query Number 2... 28 Query Number 3... 30 Sorting Queries... 30 Forms... 31 Creating a Form... 31 Navigating through records in a Form... 33 Editing records through a Form... 34 2

Inputting data into your tables using a Form... 34 Adding records through a Form... 34 Reports... 35 Creating a Report... 35 To edit the Report... 36 Appendix A... 39 Good Database Design... 39 Appendix B... 41 Exercise... 41 Tables... 41 Relationships... 42 Queries... 42 Forms... 43 3

Introduction What is a Database? A database is simply an organised collection of data. It can be something as simple as a database that tracks your CD or DVD collection. A database relies on software to organise the storage of the data and to enable a person or a program to extract desired information. This software is referred to as the Database Management System (DBMS). Microsoft Access is one such example. It is the piece of computer software designed for the purpose of managing your database. It allows you to input information into your database retrieve information from your database and generate reports. The design of the database is the most important part of it, you must look at how you want to use the information in the database and what sort of information you want to extract. Please see Appendix A Benefits of Using a Database A database is used to store information on topics so that we can analyse the stored data. For example, a database could store department information. With this database you could create mailing lists, reports, and analyse data. Each piece of data is stored in a separate field for flexibility. Once your data is broken down into discrete units of data, you can use Access to analyse and present your data in any way you wish. If each person s surname is a discrete unit of data you can tell Access to alphabetise your staff by name or to find the annual leave time that Smith placed yesterday. Microsoft Access Description As we mentioned above Microsoft Access is a powerful program to create and manage your databases. It has many built in features to assist you in constructing and viewing your information. First of all you need to understand how Microsoft Access breaks down a database. Some keywords involved in this process are: Database File, Table, Record, Field, Data-type. Here is the Hierarchy that Microsoft Access uses in breaking down a database. 4

Database File Table Field Datatype Value Database File This is your main file that encompasses the entire database and that is saved onto your computer Example Students.accdb Table: A table is a collection of data about a specific topic. There can be multiple tables in a database. Example #1) Students Example #2) Courses Field: Fields are the different categories within a Table. Tables usually contain multiple fields. Example #1) Student LastName Example #2) Student FirstName Datatypes: Datatypes are the properties of each field. A field only has 1 datatype. Elements of an Access Database A database stores information in an organised way, and makes it easy to get information from 5

Tables store data within the database Forms make it easy to put data into tables Queries pull out specific data Reports present data in a more readable format How the Information is Stored Information in the database is stored in Tables. Before you start to enter data you must create your tables. The table will store information in records (Rows) and fields (Columns). Each table is usually about a certain category of objects or people, for example: Author Location Style Inventory list Inside each table are fields. These fields are used to store the specific item of data, such as author name or literary works name. A field is represented inside the database by a column or a cell in a table. In a Relational Database, like Microsoft Access, you store information about different subjects in separate tables. To bring this information together in a meaningful way, you create relationships between the tables within the database to cross-reference the information. 6

Getting Started Opening Access 2007 In Windows XP Click on the Start Button Select All Programs Click on Microsoft Office Select Microsoft Office Access 2007 In Windows Vista Click on the Start Button In the Start Search field type Access Select Access 2007 from the search results The following screen appears: Click Blank Database 7

When you click on blank database, the Task Pane will be displayed at the right hand side of the screen. Click Create a new file. You are given a number of options as to how to create your database. Choose Blank database. You are then prompted to save and name the database To name the database: click on the Filename textbox and delete the contents. Now write in the name you will be using for your database Name the Database INVENTORY + your initials Click the drop-down arrow beside My Documents and choose where you will save the database. When you have named the database, click on Create. From this screen you will be able to create all the necessary parts of your database. These will then be used to manipulate the data held within. This window is called the Database Window. 8

Meet the new look Access 2007 Window When you create or open an Access 2007 database here is what you see. The Ribbon The Quick Access Toolbar The Microsoft Office Button The Navigation Pane The Navigation Pane shows you just what's in the database you're using. 9

The Office Button Located on the top left hand corner of the screen the Office Button can be seen as a replacement for the file menu. The options normally found in the file menu such as Open, Close, Save, Save As and Print can all be found there. The figure here shows the layout of the Office Menu. You can clearly see the location of Open, Save, Save As and Print. Introducing the Ribbon Bar The Ribbon is organized around common activities. Each Ribbon tab contains the commands you need for that activity, gathered into logical groups. When you click on the different tabs you then have the associated ribbon groups see the examples below. 10

The Ribbon tab is organised into several groups of commands so say for example If we want to create something then we go to our create tab. After we click our create tab. We are presented with a tables group that allows us to create tables from the table s group forms, from the forms group and queries from the queries group. You can minimise the ribbon by double clicking on any tab and to get it back again just double click on any tab again. The Quick Access Toolbar The Quick Access toolbar can be located on the upper left hand corner next to the Microsoft Office button. It contains the things that you use over and over every day: Save, Undo, and Repeat. You can add your favourite commands to it so that they are available no matter which tab you are on. For example you if have the print preview command on your Quick Access toolbar the button would be available to you whether you are looking at forms, reports queries or tables. Customizing your quick access toolbar Click Customize Quick Access Toolbar. In the list, click Show Below the Ribbon or Show Above the Ribbon. 11

Add a command to the Quick Access Toolbar You can add a command to the Quick Access Toolbar directly from commands that are displayed on the Office Ribbon. On the Ribbon, click the appropriate tab or group to display the command that you want to add to the Quick Access Toolbar. Right-click the command, and then click Add to Quick Access Toolbar on the shortcut menu. DIALOG BOX LAUNCHER At first glance, you may not see a certain command from a previous version of Access. Some groups have a small diagonal arrow in the lower-right corner. The arrow is called a Dialog Box Launcher. If you click it, you'll see more options related to that group. Those options will often appear in the form of a dialog box that you may recognize from a previous version of Access. Or they may appear in a familiar-looking task pane. 12

Back to Access 2007 We will now look at how to use the following objects of a database: Tables Queries Forms Report Tables Tables are the fundamental building block of any relational database; it is used to store data. Before data can be entered you must first design the table to hold the information. It is essentially a grid of rows and columns that contains a unique aspect of data we are trying to track. Below is an example of a table that contains information about books. 13

Many records combine to make a table; you can have many tables in a database. All fields should hold just a single piece of information. Creating a Table in Design View The most flexible way to create new tables is in Design View. This view enables you to set the field names in the table as well as parameters related to the fields, such as data type and description. Click the arrow under View Select Design View Name your Table Click Save From here you can create the Fields (columns) in which the data is stored, by entering the Field Name, Data type and Description. Field Name: This is the name of the field/column heading that will hold a piece of data. Data Type: The format of the data to be entered in the field Text Memo Number Date/Time Currency AutoNumber Text allows the user to enter both text and number into the field. This field can contain up to 255 characters. The Memo data type is an extended text data type that can hold up to 64,000 characters. This data type allows only numerical data. Use this for fields that are required to have a time or data format. Use this for fields that are required to have a currency data format. Sequential numbers automatically inserted by Access. Numbering begins with 1. Mainly used for primary 14

key of table. Yes/No Lookup Wizard Use this for fields that are required to have a true/false value. Use this when you are choosing from a set list of entries. The view button will give you the option to view the table in 1. Design View 2. Datasheet View Table Design View This is the view that we have been currently working in, used to design the table. Table Datasheet View This is the view of the table as it appears after it has been created and it is from this screen that you will enter data to be stored in the table. At this screen you will find the Style No field highlighted, this field is your Primary Key and is created using an autonumber so the user is unable to edit or change the data in this field. Press the tab key to bring you into the Stars field. You may enter text into this field as it has a text data type. Easy data entry Two basic ways to enter data: Enter data in the first blank cell and press RIGHT ARROW Then enter data in the next blank cell. Or Copy data from another source Excel or tables in Access, Microsoft Office Word click that first blank cell, and paste. If you've entered data in Excel, you'll have no problem entering data in Access. Just select the first blank cell and start typing. When you finish, press the RIGHT ARROW key, or the Tab key. When you 15

do that, Access writes a name in the field header above the cell and automatically creates a new, blank field. You can repeat that process as often as you need to enter data in a new cell and press the RIGHT ARROW key again. You can also change the names in the field headers at any time. We'll show you how to do that later in this course. What's more, you can copy data from sources such as Excel worksheets and paste it into a new Access table. When you do that, you can paste data or data and column headers. In addition to copying data from Excel, you can use data from tables in Access and Word. The process uses standard commands. Just select and copy your data, click the first blank cell in the new table, and click Paste. A small dialog box asks you to confirm the operation, so click Yes, and you're done! Creating a Table Click on the create tab Click Save Name your Table 16

Note: It s a best practice to not use spaces when naming tables Description: Here you enter a descriptive sentence about the contents of the field. This is especially handy if you are working in a team the description will document the objects so everyone on the team will know what they are used for. In this database we will be creating four tables. The names of these tables are: Styles Authors Location Inventory List The first three of these have only two fields. To create your table, fill in the table design as below. 17

We will first create a Style Table Style Number Style Name 1 Short Poem 2 Long Poem 3 Fiction 4 Non Fiction 5 Play From the File menu, click on the x to the right of the table The Style table, which you have just created, is now added to the database window. Now we will create the second table within the database: The Authors table. To Create The Authors Table: 1. Click on Create Tab and select the Table button. 2. Ensure you are working in the design view 3. Type Authors in the Save As box and click ok 4. When prompted to Save, click on Yes. 5. Click on the Datasheet View button from the toolbar and enter the data from the below in the fields displayed. Author No Author Name 1 William Blake 2 John Milton 3 P B Shelley 4 Samuel Beckett 5 Oscar Wilde 6 Bram Stoker 7 Mary Shelley 8 Charlotte Bronte 9 Patrick Suskind 10 Chuck Palahnuik 18

The Primary Key The power of a relational database such as Microsoft Access comes from its ability to quickly find and bring together information stored in separate tables using queries, forms and reports. In order to do this, each table should include a field or set of fields that uniquely identify each record stored in the table, say for example we had two actor named John Smith in our actor table how else would we tell the difference between the two This field usually comes in the form of a number (member s identification number, or invoice numbers are good examples). This information is called the primary key of the table. Once you designate a primary key for a table, to ensure uniqueness, Microsoft Access will prevent any duplicate or null value being entered in the primary key field. The primary key is set by default to the first field you enter. To Select the Primary Key Highlight the Author Number field by clicking on the grey box to the left of Author Number and then press the Primary Key button on the toolbar. Press the Save button, and name the table Authors. Click OK. Now that the table is created and named you can enter data into the table. To enter the data into the table press the Datasheet View button on the toolbar. From the File menu, select Save and then Close. The next table to be created is the Location table. To create The Location Table: 1. Click on Create Tab and select the Table button. 2. Ensure you are working in the design view 3. Type Locations in the Save As box and click ok 4. When prompted to Save, click on Yes. 5. Click on the Datasheet View button from the toolbar and enter the data from the below in the fields displayed. 19

Locations Number Locations 1 University Library 2 Department Library 3 Online Store 4 Lost 5 On Order From the File menu, select Save and then Close. Now that the three smaller tables are complete, you will have to create the main table in the database. This table will hold the main information about the works and will be related to each of the other smaller tables i.e. Style, Authors and Locations. There will be three fields (columns) in the Inventory table that relate to a corresponding field in each of the smaller tables: Style No Style Number (Style Table) Authors No Authors Number (Authors Table) Location No Location Number (Location Table) To Create The Inventory Table: 1. Click on Create Tab and select the Table button. 2. Ensure you are working in the design view 3. Type Inventory in the Save As box and click ok 4. When prompted to Save, click on Yes. 5. Click on the Datasheet View button from the toolbar and enter the data from the below in the fields displayed. 20

Work No Work Name Comment Style Author Location No of copies 1 A Poison Tree Thought provoking 1 1 2 16 2 Julian and Madallo 3 The Importance of being Ernest Dark 2 3 2 10 Satirical 5 5 1 4 4 Dracula Scary 3 6 1 8 5 Paradise Lost Multi-layered 2 2 4 7 6 Endgame Needs concentration 7 Frankenstein Very different to the myth 8 Perfume Far better than the movie 5 4 3 3 3 7 1 5 3 9 5 9 9 Non Fiction Gritty 4 10 2 11 10 Jane Eyre Very descriptive 5 8 4 20 From the File menu, select Save and then Close. All the tables, which are required for the database, have been created. Relationships As we mentioned earlier Microsoft Access 2007 is an example of a relational database application. This means that it is a database with related objects, this allows us to reduce redundancy i.e. data repetition. With a relational database establish links/relationships among tables in order to cut down on number of redundant fields. When you create a relationship between tables within a database, a link is established between fields across the tables. The link is called a relationship. A relational data base is a set of linked tables that share information. 21

If you are designing a database that will track information about books, you might have a table called Titles that stores information about each book, such as the book s title, date of publication, and publisher. There is also information you might want to store about the publisher, such as the publisher's phone number, address, and zip code. If you were to store all of this information in the titles table, the publisher s phone number would be duplicated for each title that the publisher prints. A better solution is to store the publisher information only once in a separate table, Publishers. You would then put a pointer in the Titles table that references an entry in the Publishers table. To make sure that your data is not out of sync, you can enforce referential integrity between the Titles and Publishers tables. Referential integrity relationships help ensure that information in one table matches information in another. For example, each title in the Titles table must be associated with a specific publisher in the Publishers table. A title cannot be added to the database for a publisher that does not exist in the database. One-To-Many Relationships A one-to-many relationship is the most common type of relationship. In this type of relationship, a row in table A can have many matching rows in table B, but a row in table B can have only one matching row in table A. For example, the Publishers and Titles tables have a one-to-many relationship: each publisher produces many titles, but each title comes from only one publisher. A one-to-many relationship is created if only one of the related columns is a primary key or has a unique constraint. In Access, the primary key side of a one-to-many relationship is denoted by a key symbol. The foreign key side of a relationship is denoted by an infinity symbol. Many-To-Many Relationships In a many-to-many relationship, a row in table A can have many matching rows in table B, and vice versa. You create such a relationship by defining a third table, called a junction table, whose primary key consists of the foreign keys from both table A and table B. For example, the Authors table and the Titles table have a many-to-many relationship that is defined by a one-to-many relationship from each of these tables to the Title Authors table. The primary key of the Title Authors table is the combination of the au_id column (the authors table s primary key) and the title_id column (the Titles table s primary key). One-To-One Relationships In a one-to-one relationship, a row in table A can have no more than one matching row in table B, and vice versa. A one-to-one relationship is created if both of the related columns are primary keys or have unique constraints. 22

This type of relationship is not common because most information related in this way would be all in one table. You might use a one-to-one relationship to: Divide a table with many columns. Isolate part of a table for security reasons. Store data that is short-lived and could be easily deleted by simply deleting the table. Store information that applies only to a subset of the main table. A database should be designed to minimize data redundancy by dividing the data into tables so that each fact is only represented once. A relationship between tables allows Office Access 2007 to bring this data back together by displaying information from more than one table at a time. To do this: Note: Ensure all tables are closed before going into Relationships 1. Click on the "Database Tools" tab and Click on the "Relationships" icon. Click this icon to bring up the "Relationships" window. 2. Double click on each of the four tables to add them to the Relationships window. 3. Click on Close 23

To prepare the window: 1. Click on the title of a table with the left mouse button, hold the mouse button down and drag the tables so they look like the diagram above. Let s think about it in English First This will help you as all fields are shown, and the three main tables are at one side of the main table. To Create Relationships between tables: The first relationship that you are going to create is one between: Style Number in the Style table Style Number in the Inventory table To Create the Relationship: 1. Hold down the left hand mouse button on the Style Number field and drag over to the Style No field in the Inventory table. 2. The following dialogue box will appear 24

3. Click on the Enforce Referential Integrity box. 4. Then click on the Create button. Note: If an error message occurs when you click on create this means that data has been entered incorrectly into one of the original tables in the database. Close the relationships window and examine each of your tables in Datasheet & Design View to locate the error. The relationship that has been created will now allow the Inventory table to lookup and merge the data stored in the Style table. Now create the relationships between: Authors Number in the Authors table & Authors No in the Inventory table. Location Number in the Location table & Location No in the Inventory table. When you have created these relationships your screen should look like the previous page. Once all the relationships have been created Click on the Office button and Save. 25

Now that you have created your relationships, the Inventory table will be able to read data from the following tables: Style Author Location Queries A query is a way to get specific information from the database. Basically you use queries to ask your database questions. When you run a query in Access the results appear in table format, giving you just the data you asked for e.g. if you only want to retrieve the films within the database which have a rating of 15 years of age and older. To Create a Query: Click on the create tab In the ribbon click Query Wizard When the New Query window appears, make sure Simple Query Wizard is selected Click the OK button 26

Now you are ready to start deciding on what tables you need to take information from to run your query. Query Number 1 Can I have a list of all the Authors please? As can be seen from the query above, we will be taking our information from the Authors table as a result we will need to add this table to our query. To add this table to our query: Select Authors table from the dropdown menu The fields that you will be searching are: Author Number Author Name So we need to add these fields to our query Click on Author Number Click the button Click on Author name Click the button 27

Click the Button When the final Screen appears Name your Query as Author Query Click the Button. Query Number 2 This one is a bit tougher as a criteria is set Can I have a list of works of which there are less than 10? For your third query you will be taking information from the Inventory table. Click the Create tab Simple Query Wizard To add this table to your query: Select Inventory table from the dropdown menu The fields that you will be searching are: Works name No of copies So we need to add these fields to our query by double clicking on them. 28

Click the Button Now we need to set out Criteria for number of works of which there are less than 10 copies Click modify the query design Click Finish. Click into the criteria row in the No of copies column Now Type >10 as above To view the results of the query press the Run Query Button on the Ribbon You will then be presented with the list below Save the Query. 29

Query Number 3 Test Exercise. Can you tell me which works are in the university library and how many copies of each there are? Sorting Queries If you do not specify how you want your query sorted, it will be sorted on the Primary Key, i.e. the position they were in when entered into the database. In order to sort your list Click into your query Click into column you want sorted Go to the sort and filter group on the ribbon Click on to sort the list alabetically from A to Z You will be presented with a list like this. 30

Forms Forms provide a user friendly, input method to tables in our database, you can browse data in a table using your form, and you can also use forms to report data. Creating a Form 1. Click the Create tab. 2. In the Ribbon, click More Forms Form Wizard. The wizard provides step-by-step instructions to guide you through the creation of a form. From this wizard you will be able to pick the tables or queries that your form will take information from, the layout of your form and the background of your form. Here we are going to take information from our Inventory Table and lay it out on our form. From Tables/Queries box in the form wizard: 1. Click on the drop down arrow. 2. Choose Table: Inventory. 3. You will now see a list of the fields used in that particular query. You can choose which of these you wish to have in your form. 4. Click on the Select All button at the right hand side. This moves all fields into your form. 5. If you don t want to select all the fields, click on the single forward arrow to add individual fields. 6. Click on the Next button. 7. Choose Work name 31

8. You will now be asked to choose how you would like to see your data. Select Columnar. 9. Press Next. 10. Select style for your form. 11. Click on the Next button. 12. Name the form Inventory List 13. Press the Finish button. 14. Your form is displayed on screen. 32

Navigating through records in a Form To navigating through each record uses the navigation buttons at the end of the form screen. First Record Previous Record Next Record New Last Record Record By using these buttons the user can go from record to record or directly to the first or last record in the form. The text box between the buttons shows the number of the current record and the number at the end shows the total number of records available to look at. 33

Editing records through a Form It is possible to edit records to the database through a form 1. Click on the desired field that you want to edit e.g. Works name. 2. Use the keyboard to edit the text in the box. Inputting data into your tables using a Form Forms are not just used for the output and editing of records but can also be used for adding records to your database if the form has been created using a table We want to add Lord Byron to our Authors Table using a form. You will notice that on your record navigation bar the number of records has been incremented by one. Note: When adding a record through a Form the data types and rules set up at the design stage of the table still apply. Adding records through a Form Forms are not just used for the output and editing of records but can also be used for adding records to your database if the form has been created using a table Create a new form using the table Inventory and select all available fields to be viewed in the form. 1. Click the New Record button. 2. Fill in all the fields in the form. 3. Click on the File menu and choose Save You will also notice that on your record navigation bar the number of records has been incremented by one. Note: When adding a record through a Form the data types and rules set up at the design stage of the table still apply. 34

Reports Forms are what we use for data entry Reports are what we use for data output. Printing the data stored in tables or the information gathered from queries is an essential part of using a database. Access Report Wizards provide easy-to-use yet powerful tools for creating reports in several predefined formats. Even if you plan to customise the designs later you ll save time if you use the Report Wizard to set up reports. Creating a Report 1. Go to the database window. 2. Click on the Create tab. 3. Click on Create report by using wizard. This is the report wizard from which you will choose the tables or queries that will be the data source for your report. 1. Choose the query called Inventory List from the Tables/Queries list. 2. Select the available fields by choosing the Select All button. 3. Click Next. Adding grouping levels will group the films by name or running time 4. Press Next again. You will now be asked what any grouping levels Click Next. 5. You will now be asked what field you want the records sorted by. 6. Choose Tabular from the layout and click Next. 7. Choose one of the styles for the background of the report and click Next. 8. Name the report Inventory List click Finish. 9. You will now be shown a Print Preview of the report. 35

To edit the Report 1. Click the View button on the toolbar. 2. Select Design View. We see that in the report that part of the work name has been cut off, therefore some editing needs to be done. 36

1. To see the resulting Report Click on the Office Button 2. Choose Printing 3. Choose Print Preview and that preview how your report will look. Now just for practice we are going to change the title of our report. In order to do this we must once again edit our Report. 1. Double click on your Report in the Navigation Pane 2. Click Views Click Design View 3. Click on the report title to edit the text. 4. Change the title to Inventory Report 5. Go back to the Print Preview. You can now see the changes that you have made to the report. 37

38

Appendix A Good Database Design The database must be designed to store the data necessary to support information requirements defined during the design process and any possible ad hoc queries that may be posed by the users. Before you even attempt to open Microsoft Access it is very important that you take a pen and paper and write down exactly what information needs to be stored and what kind of queries you will be running on the database. By writing down this information it will be easier to make out your tables and decide what information needs to be stored in each of those tables. The tables must be constructed properly and efficiently. Each table in the database must represent a single subject only and should be composed of relatively distinct fields which keep redundant data to an absolute minimum and should be identified throughout the database by a field with unique values. Example Let s pretend we work in the Registrar s Office, we want to create a database that holds student records and information about courses. Let s think about, what kind of questions we would be asking our database if we were working in the registrar s office. What kind of questions are we going to be asking the database? 1. How many currently enrolled Students do we have? 2. How many Students do we have from a particular County? 3. Give me a full list of courses that the university runs 4. How many Students are enrolled on a particular Course? 5. Which Students are due to expire shortly? 6. Which Course is the most popular? Please bear in mind that you won t always know the exact queries you ll be running there will always be ad-hoc ones but it is always a good idea to keep in mind the ones you definitely know you will be asking. It also may seem a little hard for you to think up questions and there design of you database here but when the database being created is in relation to your own department it will be way easier. Every student has a name a student number an address a phone number an email address and a course that they are doing in college. Each table in the database must represent a separate subject. So, here we have Students and Courses so we know straight away we will have a student s table and a courses table. 39

Let s Brainstorm Courseid Course Coursename Coursecost Duration Let s create our Courses table Course Course Courseid(varchar) Coursename(varchar) Coursecost(int) Duration(int) Let s Brainstorm for our Students County Country Telephone Title City Mobile Student First name Date Of Birth Email Course Address Line3 Address Line 2 Address Line 1 Last name Enrolment Date Start Date End Date Student Type 40

Appendix B Exercise The aim of this exercise is to get you to create your own database from scratch. The tables, queries and forms that are required are listed below. Tables Table Name: Makes Make No Make Type 1 Ford 2 Opel 3 Toyota 4 Lexus 5 Mercedes 6 Mazda 7 BMW Table Name: Models Car No Make No Model Price Reg No 1 1 Mondeo 6100 94 WW 8967 2 2 Corsa 7500 96 C 21743 3 3 Corolla 5500 94 C 12932 4 1 Focus 15000 99 14865 5 1 Escort 8750 97 C 3422 6 3 Avensis 15250 98 C 25635 41

7 3 Starlet 7500 97 D 14032 8 2 Vectra 9550 96 D 164783 9 4 Soarer 15200 92 C 14733 10 5 C180 23500 95 D 27453 11 6 323 8000 94 C 18939 12 7 316 I 16950 95 C 4753 13 5 E 320 8950 96 WW 6932 Relationships Create a relationship between both tables; join the field Make No from the Makes table to the field Makes No in the Models table. Queries Query 1: Create a query to: Display the following fields Make Type (Makes Table) Model (Models Table) Price (Models Table) Reg No (Models Table) Ask the user to input the Make of car they would like. Criteria: Like [Enter Car Make:] Query 2: Create a query to: Display the following fields Make Type (Makes Table) Model (Models Table) Price (Models Table) Reg No 42

Find all the cars in a certain year, where the user can specify the year of the car. Criteria: Like[Enter Car Year:] NB: Don t forget to use the asterisk after entering a year e.g. 94* Query 3: Create a query to: Display the following fields: Make Type Model Price Reg No (Makes Table) (Models Table) (Models Table) (Models Table) Show all the cars within a certain price range e.g. 5000 and 9000. Criteria: Between [Enter Lowest Price:] and [Enter Highest Price:] Forms Create three forms in your database, one for each of the queries that you have created. 43