Creating tables in Microsoft Access 2007



Similar documents
Microsoft Access Creating Filters and Tables

Microsoft Access 2010 handout

Creating forms in Microsoft Access 2007

Microsoft Access 2010 Part 1: Introduction to Access

Introduction to Microsoft Access 2013

Introduction to Microsoft Access 2010

Microsoft Access 2010 Overview of Basics

Planning and Creating a Custom Database

Check out our website!

Microsoft Office 2010

Introduction to Microsoft Access 2007

TimeValue Software Due Date Tracking and Task Management Software

MICROSOFT ACCESS 2007 BOOK 2

Using an Access Database

Microsoft Access Basics

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

Basic Microsoft Excel 2007

ECDL Module 5. REFERENCE MANUAL Databases. Microsoft Access 2003 Edition for ECDL Syllabus Four

MICROSOFT ACCESS TABLES

Removed from product. > Removed from product. > Removed from product. Navigation Buttons Filter Toggle > Removed from product

Excel 2003 Tutorial I

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

MICROSOFT ACCESS 2003 TUTORIAL

COURSE DESCRIPTION. Queries in Microsoft Access. This course is designed for users with a to create queries in Microsoft Access.

Microsoft Office Access 2007 Basics

Access 2007 Creating Forms Table of Contents

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

Microsoft Access Introduction

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

Excel for Data Cleaning and Management

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

Access 2010: The Navigation Pane

Introduction to Microsoft Access 2003

EXCEL Using Excel for Data Query & Management. Information Technology. MS Office Excel 2007 Users Guide. IT Training & Development

Training Needs Analysis

Creating and Using Databases with Microsoft Access

Microsoft Excel 2010 Tutorial

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

Maximizing the Use of Slide Masters to Make Global Changes in PowerPoint

Microsoft Access 2007 Introduction

Introduction to Microsoft Office Access 2010

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

Business Objects Version 5 : Introduction

Getting Started with Excel Table of Contents

MICROSOFT OFFICE ACCESS NEW FEATURES

Microsoft Access 2007

Excel 2007 Basic knowledge


IST 195 Lab 11: MS Access

Create a New Database in Access 2010

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

STATEMENT OF TRANSACTION REPORT ANALYSIS USING EXCEL

Beginning Microsoft Access

ACCESS 2007 BASICS. Best Practices in MS Access. Information Technology. MS Access 2007 Users Guide. IT Training & Development (818)

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

Enterprise Interface User Guide

SAP Business Intelligence (BI) Reporting Training for MM. General Navigation. Rick Heckman PASSHE 1/31/2012

MICROSOFT ACCESS STEP BY STEP GUIDE

BusinessObjects: General Report Writing for Version 5

Qualtrics Survey Tool

CareAware Capacity Management - Patient Flow Patient List Gadget

Objectives. Understand databases Create a database Create a table in Datasheet view Create a table in Design view

Introduction to Microsoft Access XP

Steps to Create a Database

Introduction to. Microsoft Access Practicals

IN THIS PROJECT, YOU LEARN HOW TO

Crystal Reports Payroll Exercise

Google Docs Basics Website:

Intro to Excel spreadsheets

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

Intellect Platform - Tables and Templates Basic Document Management System - A101

Microsoft Access 2007 Module 1

How to set up a database in Microsoft Access

Reduced Quality Sample

Appointment Scheduler

Excel Database Management Microsoft Excel 2003

Tutorial 3. Maintaining and Querying a Database

Microsoft Office 2010

Excel Reports and Macros

Access Database Design

Access Queries

Tutorial 3 Maintaining and Querying a Database

MICROSOFT OFFICE ACCESS LEVEL 1

Access Creating Databases - Fundamentals

Learning Services IT Guide. Access 2013

Access Tutorial 3 Maintaining and Querying a Database. Microsoft Office 2013 Enhanced

Microsoft Excel 2010 Part 3: Advanced Excel

MS Access Lab 2. Topic: Tables

TheFinancialEdge. Fast! Guide

Excel 2010: Create your first spreadsheet

CREATING EXCEL PIVOT TABLES AND PIVOT CHARTS FOR LIBRARY QUESTIONNAIRE RESULTS

Decision Support AITS University Administration. Web Intelligence Rich Client 4.1 User Guide

Word 2007: Basics Learning Guide

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

Access Tutorial 1 Creating a Database. Microsoft Office 2013 Enhanced

Microsoft Access Part I (Database Design Basics) ShortCourse Handout

Transcription:

Platform: Windows PC Ref no: USER 164 Date: 25 th October 2007 Version: 1 Authors: D.R.Sheward, C.L.Napier Creating tables in Microsoft Access 2007 The aim of this guide is to provide information on using tables in Microsoft Access 2007. A basic knowledge of Microsoft Access and databases is assumed. Other documents in the series are: USER 163 Introduction to Microsoft Access 2007 USER 165 Filters and queries in Microsoft Access 2007 USER 166 Creating forms in Microsoft Access 2007 USER 167 Producing reports from Microsoft Access 2007

Before you start It is advisable to plan your database on paper first. Consider how many tables you will require, what data the tables will hold and how the tables will be structured. Try to identify and repeated or common types of data. Why do I need a table? The data for your database is stored in tables. Records are stored in the rows of the table; fields are stored in the columns of the table. Each record can be uniquely identified through a Primary key field. Getting started Open Microsoft Access 2007 and create a new database file. See the guide USER 163: Introduction to Microsoft Access 2007 for details of how to do this. Creating a table When you open a new database, the first table will be created automatically. To insert another new table: Select the Create tab Click the Table button If you would like Access to create a table using sample field names, click the Table Templates button and select the type of table you require. Finding your way around Access Access has two main working views: Design View is used to construct the framework of the database, e.g. specifying field names, defining queries and creating forms 2

Datasheet View is used to manipulate the database, e.g. to add or edit data, view records or run queries To switch between views: Right-click on the name at the top of the table and select the view that is required. Adding field categories In Design View, the first column is for your field names, for example surname, first name, address etc. These will appear across the top of your database table. The second column refers to Data Type. You must define the type of data that the field will hold, e.g. text, number, date etc. The third column is for providing a description of the field. This is optional, but it can be useful to provide more information about expected data types or format. Click on the first cell in the Field Name column. This is currently called ID and you may keep this if you wish. To change the Field Name, delete the contents of the cell and type a new field name Press Enter on the keyboard. The neighbouring cell in the Data Type column is selected. This is currently set to AutoNumber ; to change this click the 3

blue arrow to the right of the data type field and select an alternative data type. Press Enter on the keyboard. A cell in the Description column will be selected. Enter a description if required. Press Enter on the keyboard and repeat the above process for other fields. Primary keys Each table in a database can be identified by assigning a Primary Key. The primary key should be something that is unique, e.g. identification number. Only one primary key need be assigned per table in the database. To assign a primary key: Click inside the field that you want as your primary key Click the Primary Key button (under the Design tab) or Right-click and select Primary Key A key icon will indicate which field contains the Primary key To remove a primary key: Click in the field that has been assigned as the primary key Click the Primary Key button or Right-click and select Primary Key Saving a table It is recommended that you save your table at regular intervals whilst you are working. To save the table, click the Save button at the top of the screen or click the Office Button and select Save. The table will be listed in the All Tables window on the left-hand side. 4

Renaming a table Find the table in the All Tables list (the left-hand window) Right-click on the table and select Rename Type a new name for the table Press Enter on the keyboard Deleting a table Find the table in the All Tables list Click once on the table to select it Press the Delete key on the keyboard Changing the order of field names The order that fields appear in the database can be changed in Design View. Select the row that you wish to move, by clicking on the blue square to the left of the field name. The row should become highlighted Hold down the left mouse button and drag the field up or down to the new location Deleting a field name Click on the text that you wish to delete and press the Delete key on the keyboard. Deleting an entire field Click the blue square to the left of the field that you wish to delete. This should select the entire row Press the Delete key on the keyboard or 5

Right-click at any point in the row and select Delete Rows Field Properties Setting field properties can give the database extra flexibility and functionality. The table needs to be open in Design View to access field properties. Click once on a field name The Field Properties will appear at the bottom of the screen. Click the General tab Choose a property and click on the white space next to it The application of a property depends on its type. You may need to type a value, click a button and choose from a list of options or click a button and use a Wizard to develop the property. When you click a property, a description will appear in the space to the right. You can obtain further help by pressing the F1 key on the keyboard. Field size: Format: minimizes the size of the database by limiting the number of characters that can be typed into a field, to a maximum of 255 characters. The property is applied by typing a value into the white space customizes the way that text or numbers are displayed and printed, e.g. colour, alignment etc. 6

Input mask: sets up the field to receive data in a particular format, e.g. postcodes or telephone numbers. This helps to reduce data entry mistakes. Caption: adds a label to the field to assist the user, e.g. instructions for entering data Default value: sets a value to appear in the field before you enter any data Validation rule: a condition that must be met before the data is accepted into the database. This prevents any mistakes due to incorrect or misspelled data. Validation text: this appears if a validation rule is not satisfied. It is good practice to set Validation Text when using Validation rules to remind the user of acceptable data types Required: makes data entry compulsory, so the field cannot be left blank. Adding data to a table Once the table has been created and the field and properties are defined, you can start adding data. This is done in Datasheet View. Click on the first empty record and start adding data. Moving around a table There are several ways to do this: Use the arrow keys on the keyboard Press the Enter or Tab keys on the keyboard Click in a new cell Working with records The table needs to be displayed in Datasheet View to edit records. 7

Selecting a record: The left side of the table contains a column of grey buttons To select a record, click the button next to the record. The whole record will be highlighted Click the button again to deselect the record The record number is displayed in the control bar at the bottom of the screen. These controls can also be used to navigate through and add new records. Inserting a new record: A button with an asterisk indicates the next available record in the table To enter a new record, click the New (blank) record button from the control bar at the bottom of the screen Deleting a record: Select the record by clicking the grey button to the left of the record Press the Delete key on the keyboard Backing-up a database It is important to back-up your work regularly, in case work is lost or corrupted. To back up your database in Access : Click the Office button Click Manage Click Back-up Database 8

Compacting and repairing a database Deleted records, though not visible, still take up disk space. Extensive editing can make the database inefficient in terms of speed and disk usage. Databases can also become corrupted or damaged, which may cause you to lose important work. Access has a Compact and Repair command, which can help to prevent these problems. You should compact and repair your database regularly. You should always make a back-up of your database before running Compact and Repair Click the Office button Click Manage Click Compact and Repair Database You can also configure Access to automatically Compact and Repair when you close the database: Click the Office button Click Access Options Select Current Database from the list on the left-hand side In the Application Options section, check the box next to Compact on close Click OK Changing the appearance of a table Note: to undo any changes that you do not like, click the Undo button at the top of the screen 9

Adjusting column width: Place the mouse over the right border of the column When the pointer changes to a black cross, hold down the mouse button and drag the guide horizontally or Right-click on the column heading and choose Column Width Enter a new column width value and click OK. Moving a column: Click on the column heading Click and drag the column to a new position Hiding columns: Click on the column heading Right-click and choose Hide Columns To reshow columns: Right-click on any column heading and choose Unhide Columns Check the box next to the column you wish to unhide Click Close Freezing columns: A frozen column will remain static in the table while you scroll through the remaining columns in the table. Select the column that you wish to freeze Choose Freeze Columns The frozen column will automatically be placed on the left of the table 10

Unfreezing columns: Right-click on any column heading Choose Unfreeze All Columns The column will not return to its original position, so you may have to move it Sorting table data Right-click on a cell of the column you wish to sort Choose Sort Ascending or Sort Descending Finding and replacing data Find is a basic search strategy, which will only find one instance of data at a time. For more advanced search techniques, see User 165: Filters and queries in Microsoft Access 2007 Finding data: Click on any cell of the column you wish to search in Click the Find button, which is located in the top-right corner of the screen The Find and Replace window will appear Type the data you are searching for 11

Complete the boxes Find What: type in the data you want to find Look In: Match: select where you wish to search this can be the current column or the whole table choose whether the data should match all or just part of your search Click the Find Next button Finding and replacing data: Click the Find button Click the Replace tab from the Find and Replace window Or Click the Replace button Importing data from Microsoft Excel Click the External Data tab Click the Excel button The Get External Data window will appear 12

Locate your Excel file by clicking the Browse button Specify whether you want to create a new table, or add data to an existing table by selecting the relevant option Click OK Importing data from Microsoft Word Make sure that the data in Microsoft Word is separated by commas Save the Word file in the Text only format Click the External Data tab in Access Click the Text File button Locate your file by clicking the Browse button Specify whether you want to create a new table, or add data to an existing table by selecting the relevant option Click OK Printing a table Open the table that you wish to print in Datasheet View Click the Office Button Choose Print Printing selected records from a table: Select the records that you wish to print by clicking on the box to the left of the record. Hold down the Shift key on the keyboard to select more than one record Click the Office Button 13

Choose Print Choose Selected Record(s) Related tables and relational databases A very simple database need only have one table, but it would not make an efficient or flexible database. By breaking a large table into several smaller tables and establishing relationships between common themes in these tables, the database will be able to hold a wider range of data, offer greater flexibility when retrieving information and help to prevent duplication of the same information. This type of database is commonly known as a Relational Database. The common theme forming the basis of the relationship between tables is usually a unique code or key, of which there are two types, a primary key and a foreign key. The primary key is used to uniquely identify a record in a table; a foreign key is a field that corresponds to the primary key of another table this is what forms the basis of the link or relationship between the tables. The table holding the primary key is known as the Primary table; the table with the foreign key is the Child. Consider a student database. It could contain a table called student_info and a table called award holding the following details: Primary key Foreign key The student_info table would contain a primary key to uniquely identify each student, for example, the student registration number, and also an Award code to link to details about a particular course. The award table would contain a primary key to uniquely identify a course, for example, the Award code. 14

Primary key Foreign key In this instance, the Award code on the student_info table would be a foreign key as it corresponds to the primary key of the award table. The student_info table would be the Primary table and the award table would be the Child table. There are three different types of relationships between tables: One to one - a record in one table corresponds to one record in another table One to many a record in one table corresponds to multiple records in another table. This is the most common type of relationship, for example, an award will have many students Many to many multiple records in one table will correspond to multiple records in another table When creating relationships between tables in Access : Work out the relationships on paper first One to many is the most common relationship; the other relationships are less common, so you may need to re-consider the design of your database There can only be one type of relationship between any two tables The tables that form the relationship must be of the same data type and contain the same kind of values In one to many relationships, the table on the one side must be the primary table You cannot delete the table that is the primary table in a relationship. You must delete the relationship line first Creating relationships: Lines are used to display which tables are related. 15

To create a relationship: Close all tables Click the Database Tools tab Click the Relationships button The Show Table box will appear Select the required tables and click Add Click Close when you have finished adding tables To add a relationship line: Locate an instance of the common field appearing in both tables, for example Award code Click and drag between the two common fields The Relationship Options window will appear to allow you to define the nature of the relationship 16

Enforce Referential Integrity this helps to ensure that the relationships are valid. It prevents the entry of links to non-existent records and prevents the deletion of a relationship that would affect the operation of the database Join type when you perform a query, Access will look at the join type and take this into consideration when retrieving data Editing a relationship: Open the Relationships window by clicking the Relationships button Tables can be moved around the Relationship window by dragging and dropping them Deleting a relationship: Click once on the relationship line between the tables Press the Delete key on the keyboard Deleting a table from the Relationships window: Click once on the table Press the Delete key on the keyboard Closing the Relationships window: When you close the Relationships window, you will be prompted to save the layout if this has not been done already. Where next Once you have added data to the tables, the next step is to create queries and searches for your database. See User 165: Filters and queries in Microsoft Access 2007 17

Where to go for more help or information You can get further help from the Information Services Help Desks at: Thompson Library: 01782 294771 Brindley IT Centre: 01782 294135 Octagon IT Centre: 01785 353339 Online: Email: www.staffs.ac.uk/ishelp libraryhelpdesk@staffs.ac.uk (for all IT and Library queries) All Microsoft product screenshots and references are used by permission of the Microsoft Corporation. Windows operating system 18