You are on page 1of 8

Microsoft Access 2007 Basics & Database Fundamentals

Page 2

Access 2007 Basics and Database Fundamentals

Topics: -

What is a database? Why use Microsoft Access Database Terms Planning a database Creating a Table in Design View Creating a Query in Design View Creating Forms and Reports using Wizards Linking Tables

Worksheets: What is a Database?...................................................................................................................1 Why use Microsoft Access?......................................................................................................1 Reports are created to print out your data in a formatted structure...........................................1 Planning the Database................................................................................................................2 Basic Access Tools....................................................................................................................3 Tables.....................................................................................................................................3 Queries...................................................................................................................................4 Forms.....................................................................................................................................5

Updated: 08/05/09

Page 1

What is a Database?
A variety of definitions exist for a database, but essentially it is a collection of information, regardless of how that information is stored. A filing cabinet, a Rolodex, a library card catalog and the Internet are all types of databases. Most often, however, the word "database" is used to describe a collection of related "data" (information) stored on computers. An electronic database should allow you to store, sort and retrieve data. You can create simple electronic databases by using a Word table, or an Excel spreadsheet. These can keep data such as names and addresses. For example, here we have simple database of our patients:
MedRec# 123-456 987-654 753-951 First Name Jack Jill Mary Last Name Nimble Pail Bluebell DOB 06/08/72 08/27/65 12/08/51 Doctor Edwards Lewis Edwards

Here is a simple database of our doctors:


EmployeeID 999-999 888-888 777-777 First Name Ken Laura Yolanda Last Name Edwards Lang Lewis Phone # 555-1234 555-4567 555-7890

Why use Microsoft Access?


Microsoft Access is a "relational" database application. Relational means that we can link together sets of data, we can relate the data. We can keep track of the patients, the doctors and when the patients last saw their doctors, what happened at each visit and so on. Access allows us to relate our data, without the repetition that may occur anywhere else. In an Access file, we can create both of the datasets, and link (relate) them.
MedRec# 123-456 987-654 753-951 First Jack Jill Mary Last Nimble Pail Bluebell DOB 06/08/72 08/27/65 12/08/51 Doctor Edwards Lewis Edwards EmpID # 999-999 888-888 777-777 First Last Ken Edwards Laura Lang Yolanda Lewis Phone # 555-1234 555-4567 555-7890

In Access, the data is saved in Tables. As the data changes, all of the database objects will reflect the newest information (i.e. the Queries, Forms and Reports). Queries show the data in a Table format. A Query can pull from one or multiple Tables and allow you to limit the display by using criteria to limit the records (rows) and showing only the fields (columns) you want. We can find the phone number for Jill Pail's Doctor, and provide Ken Edwards with a list of his patients. Forms can be created to provide a "user-friendly" side to your database. They are used to view and enter your data in an interactive formatted structure. Creating forms is a great way to make your Access database more user-friendly. Reports are created to print out your data in a formatted structure.

Updated: 08/05/09

Page 2

Planning the Database


The most important part of creating a relational database is planning. This can be difficult when you are first learning to use Microsoft Access. Here are some questions that may help: 1. Input - What data do I already have to put in the database? 2. Output - What information do I want to get out of the database? 3. Process - What do I need to do to get there? a. Am I collecting the data necessary to fulfill these needs? b. Can Access do everything I want? Sometimes it helps to plan the final reports that you want from your database and see if you have a method to collect the all the data you want to display. For example, we would like to know how long our patients have to wait. There are lots of times we can collect: appointment time, time of check in, time they are escorted to an exam room, time that the doctor sees them and time at check out. We would need to decide if we want to know how long before a patient sees the doctor, how long they are waiting in the waiting room, or how long they were at our clinic, and collect the times accordingly. The tables are the core of your Access database; it's where all the 'data' is actually saved. Tables are essential to using any of the other Access Tools. When planning out your database try to remember these basic design rules for your tables. 1. Data is broken down into Smallest Logical Parts - Pulling fields together in Access is fairly simple; pulling them apart can be very difficult. Think of this as breaking up the data into its smallest sort-able part. 2. Unique Field Names - Be sure to differentiate between the field names in each table. We can have a First Name in our Patient table and a First Name in our Doctor table but these leads to confusion when we try to pull both tables into one result. 3. No Calculated or Derived Fields - Access will let you create calculations in queries, forms and reports. Putting these in your table only leads to data entry errors. a. By creating calculations we save memory space and reduce our data entry errors. If we had an employee working 40 hours for $10 per hour, we would not need a field of $400 owed. The amount owed can be "calculated" elsewhere. b. By using the relationships between our data sets, we can derive missing data. If we are creating a new appointment for a patient, we only need to put in their Medical Record Number (or other unique identifier). The patient's name, phone number and other information can be derived from the patient table. 4. Unique Records - It's important that each table has a way to keep records unique. We can do this by setting one field (column) to be a Primary Key field. When a field is a "Primary Key", Access will not allow any duplication or blanks. a. When there is not a unique field in your data set, you can use an AutoNumber. AutoNumbers are incremented or random fields that are always unique, and thus ideal for your primary key.

Page 3

Basic Access Tools


Access consists of four main tools: Tables, Queries, Forms and Reports. Each tool has at least two views: a Design view and a Data view. Tables Tables store your data. These need to be created and properly linked (related) in order to effectively use the other access tools. Tables are the core of your database, everything else in Access is used to display and manipulate the data within the Tables. Tables consist of rows and columns; the rows of the table each contain the information about one Record and the columns (Fields) each contain a type of data. The Design View of a Table allows you to create and modify: - Field Names (the column headings) - The type of data (Data Type) that can be stored in that field - Descriptions, which will be displayed in the status bar in the Data view of Forms - And the Properties of each field, such as how many characters can be typed (field size), how the data is formatted (05/05/95 or May 5, 1995).

The Datasheet View of a Table allows you to create and modify the data within a grid structure based on the settings in the design view.

Updated: 08/05/09

Page 4 Queries Queries can give you a selection of data based on criteria (limitations) you provide. Queries can pull from one or more related tables. The Design view of a query allows you to choose which tables to pull from and which fields you want to display. It also allows to you set a sort order, and your criteria to limit your data.

Criteria limit the records.

The Datasheet view in a Query looks like the datasheet view in the tables.

Page 5 Forms Most forms display data one record at a time, in a formatted user-friendly environment. You can build your form so it will display multiple records. As you develop forms you can create navigation buttons, insert graphics, and change the colors to display everything consistently. Forms have three basic views: design view, layout view and form view. Your data source is most often a Table, but can be a Query. For example, if I want to see all the patients I would use the table; if I only want to see Dr. Edward's Patients, I would use a query.

The data entered or modified in a form is automatically saved to the table. The table is the true location of the data; the form is just a pretty way to view/modify/create the data.

Updated: 08/05/09

Page 6 Reports Reports are designed to create an organized output of information from your database. With a report, you can group and summarize information. You cant edit the data in a report, but if you make the modifications in the table, query or form you will see the results when you open the report again. Reports have four basic views: Report View, Print Preview, Layout View and Design View.

You might also like