http://www.gcflearnfree.

org/

Introduction
Access 2007 is a program that allows you to create and manage databases. A database is a place where you can store information related to a specific topic. How you intend to use the information will determine whether you need an Access database or a different program to create and manage your data. In this lesson, we will discuss what a database does and how to decide whether you need a database to manage your information.

What is a Database?
A database allows you to store information related to a specific topic in an organized way. In addition to storing data, you can also sort, extract, and summarize information related to the data. One of the software programs that allow you to do this is Microsoft Office Access 2007, which is a database creation and management program.

Access 2007 Example

Why Not Use Excel?
There are many types of data you may need to store and manage: text and numbers, for example. Depending on what you want your data to do for you, you may or may not need to use a database. You might be able to use a spreadsheet program like Microsoft Excel. How do you know which data can be adequately managed with Excel and which data really requires Access to manage it more efficiently? It depends on how much data you have to manage, and what you want your data to do for you. Let's try to answer this by looking at a bookstore scenario. If you work for a bookstore business, you might have to keep track of your customers and their orders. You could use Microsoft Excel to store and manage this type of data; however, Excel is a spreadsheet software program that is traditionally used to manage numerical information, like totaling up all purchases by one customer. While it can do an adequate job at storing some types of text-based data -- like the customer's name and contact information-- that is not really what Excel was designed to do. The following examples will show you why an Access Database may be a better choice for the bookstore business.

Excel Example: Customer List and Order Trackin
Sorting and Filtering to Locate Data in Excel In Excel, you can store your data in a worksheet so that you can mail promotional information to the entire list or sort to find specific customers to target mail. You can even filter the customer information to display all the customers that live in a particular state, like in the following image. Additionally, you can sort the data to order it in a particular way.

Data Filtered to Display NC State Records However, if you want to see very specific results in your data, like how many orders a single customer placed in a year, Excel is not as efficient as Access at providing you with that data.

Data Entry in Excel
If you use an Excel spreadsheet to track your orders, each time a customer places an order, you would have to enter a new row of information in the spreadsheet. This would likely include the customer's name and address. If that customer orders from your company more than once, that information would have to be entered each time. You spreadsheet would contain redundant information. Data Sorted By Customer in an Excel Spreadsheet

As you can see in the image above, customers Tonya Bullock and McKenzie Grant each placed several orders on different days and for different books. Their customer contact information was entered every time they placed an order. This is the limitation of spreadsheet software such as Excel because it is a single, flat file.

Access Example: Customers and Orders Tracking
Entering Data in Access
Microsoft Access is designed to manage information. Access allows you to enter the client's name, address, and phone number- the first time they do an order. This information is entered into an Access table designed to hold basic customer information on clients. A table is a list of related information in columns and rows. In a table, each row is called a record and each column is called a field . An Access table in Datasheet View looks similar to an Excel spreadsheet, as you can see below. Data in an Access Customer Info Table In addition to the table with customer information, you would probably also want a table with information about the products you sell, and a third table to hold data related to specific customer orders. These tables would all be linked together, to help you make the most out of your data. Access is called a relational database management program, because the tables are linked, or related, as you can see in the image below. In this example, the Customer Info and Orders tables are linked by Customer ID and Book ID.

With Access. As you can see below. And in the Books table. you could see all the customers from a specific state.Table Relationships Diagram in Access Now. and the Order table includes information about which books were ordered. are displayed for you. You could look at the information in these tables separately to answer your question of which book was most popular in North Carolina. . Search Results Challenge! Try to answer this questions: • • • • What is a database? What type of software program is Microsoft Office Excel? What type of software program is Microsoft Office Access? Think of at least two differences between Access and Excel. The real power of Access comes in being able to link and extract information from multiple tables to answer specific questions. or query. the results of your specific question. you can see all the books that you have in stock. let's assume that you want to identify the book that was most popular in the state of North Carolina. The Customer Info table contains information about the states. this is possible because you can search and retrieve information from multiple tables at the same time. In the Customer Info table. NC. You will need information from both tables to identify the book that was most popular in a specific state.

the store inventory of products is information that has to be stored somewhere. we will provide a basic overview of Access.Introduction Once you have determined that an Access database will help you store and manage your data. you will need to learn the parts of a database. and also allow the store to quickly determine how many Brand X toasters are in the inventory without needing to count the inventory on the shelves. along with the price of each product. . if you go shopping at a department store for a toaster. it would be easier and more efficient to use one. Databases have an enormous impact in almost every area of our lives. In this lesson. Real World Example While this information could be managed without a database. the store needs to be able to store the sales information to determine the daily sales total and how to track the decrease in inventory. how to start using Access. When you make a purchase. A database could store this information. For example. including the parts of a database. and how to navigate the Access window. Databases in Our Lives Think about all the information we encounter on a typical day that might be organized by a database. and common tasks you can complete using a database.

which is a relational database program. shipped. Then. the cash register retrieves prices and the customer pays for products. In the left pane. Databases are created using programs such as Microsoft Office Access 2007. as well as the categories on Office Online. Getting Started with Access When you start Access 2007. the template categories including the featured local templates are listed. and stocked in the store. . you will see the Getting Started window.Inventory in Access Database Think About It Think about what is going on around you in everyday situations and whether there might be a database at work. The items have to be ordered. Where might databases be involved in the situation? • Restaurant: Where does the food come from? How does management know when to reorder a product? How are bills paid? • Traffic Lights: Who or what controls when the lights turn red or green? A database maintains order and structure in our lives. Templates are pre-built databases focused on a specific task that you can download and use immediately. when the customer buys the items. • Grocery Store: The grocery store is stocked with items. The store has to pay for the items.

Featured templates include database template options that are available online.Getting Started Window In the example below. the featured templates are selected. as well as templates available as part of the local version of Access. and the template options are displayed in the center area of the screen. Featured Templates .

or a blank database. . You must have an Internet connection to download these database templates. you will see a list of categories for the templates available on Microsoft Office Online. an existing database. The center of the screen will change to display icons for the templates. The Blank Database command allows you to create a database from scratch. You can open a template database stored locally or online. To View Templates Included with Access: • • Click Local Templates in the left pane. Local Templates In the left pane of the Getting Started window. Select an icon in the center of the screen. Details about the database template will appear on the right.Opening a Database You have three main options on the Getting Started page.

Select Existing Database .To Open an Existing Database: • In the Open Recent Database section. A dialog box will appear. Find Existing Database • Select the database you wish to open. It will appear in the window. Open Existing Database from List OR • Click the More link. double-click the file name of the database you wish to open.

The Access Window Before you can begin to use a database. Access Window The Ribbon Like other software in the Microsoft Office 2007 suite. color.• Click Open. The database will appear. Each tab contains groups of commands that you use to perform tasks in Access. Access 2007 has a tabbed Ribbon system that you use to navigate the database. Unless you use keyboard shortcuts for everything. alignment. the Ribbon is how you get the work done in Access. Tabbed Ribbon . The Ribbon is organized into tabs. For example. on the Home tab. size. you’ll see that there is a Font group that contains the font formatting commands such as font type. you need to become familiar with the Access window. and more.

Quick Access Toolbar Once you are familiar with Access. and Redo commands. . and more. To make it easier to use these commands. and includes the Save. you may find that you there are commands that you use more often than others. you can also change your Access Options. Save. Quick Access Toolbar Microsoft Office Button The Microsoft Office Button resides in the upper-left corner of the Access window and includes key menu options such as New. you can add them to the Quick Access toolbar. Print. Undo. From this menu. By default. the toolbar appears above the Ribbon on the left side of the Access window.

It shows you what is in the database and makes the information accessible to you. Also.Microsoft Office Button Navigation Pane The main control center of each Access database is the Navigation Pane. you can choose to close the navigation pane. . if you need more of the Access window to complete specific tasks.

Navigation Pane To Open and Close the Navigation Pane: • Click the Shutter Bar Button on the right side of the Navigation Pane. Shutter Bar Button • The Navigation Pane appears as a single column when it is collapsed. .

and reports. forms. One or more of these objects are formed when a database is created. queries. and all the objects appear in the Navigation Pane.Navigation Pane Closed Parts of a Database A Microsoft Access database is made up of several components including tables. . beginning Access users may want to reorder the objects in the Navigation Pane. These components are called database objects. To Change how Objects are Ordered in the Navigation Pane: • Click the drop-down arrow at the top of the Navigation Pane to see the ordering options. To make the database easier to navigate.

or objects. Display Objects Parts of a Database (cont. Click any upward pointing double arrow to collapse a group and hide all the objects.) A database is made up of several components. queries. The Navigation Pane will appear reordered based on your selection. To Expand or Collapse a Group: • • Click any downward pointing double arrow to expand a group so that all objects are displayed. forms.Change Object Order in Navigation Pane • Select a menu option. and reports in individual groups in the pane. If you are new to databases. These objects include: . This will group tables. arranging the objects by type in the Navigation Pane is usually a good idea.

there are columns. Each row is a record that contains the information specific to the fields listed. or fields.• • • • tables queries forms reports We'll look at each of these objects in more detail in later lessons. Table Icon In the Customer Info table below. Tables A table is the database object that contains the basic information you wish to store. A blue and white icon represents the table in the Navigation Pane. . but you can access them from the Navigation Pane like you can with tables. of information including title and author.

Entering data directly into a table can be difficult if there is a lot of information to enter. Forms A third database object is the form. Queries are covered in more detail in later lessons. an Access table is essentially a screen filled with blank rows where a user enters records. you could create a query that would retrieve information from multiple tables to determine the answer. Forms are especially useful for Access users that aren’t comfortable working with databases. Forms are an Access tool that users can create to make data entry in database tables easier. provide users with an easy-to-read interface where they can enter table data. Reports . For example. you would retrieve information from the Order table and Books table.Table Queries Another database object is called a query. In this example. however. A query allows you to retrieve information from one or more tables based on a set of search conditions you define using the table fields. if you want to know the name of the books that have sold in Colorado and Kansas. Like an Excel spreadsheet. Forms.

Close Object Challenge! See if you can answer these questions: • • • Where is the Ribbon in the Access window? Where is the Navigation Pane located? What is the purpose of each of the four objects in an Access database? Introduction The first step in creating a database is to think about why you need it -. so it can be stored in my database? How will I use the data once it's in there? This lesson will walk you through the steps of database design. and plan the tables and fields you will need for a very simple bookstore database. You will determine the purpose of the database.what is its purpose? Once you know that. Right-click the tab and select Close from the menu. you can begin designing your own database. (The highlighted tab is the active tab). Ask yourself questions like: What kinds of information will it store? How will I have to break that information down. just like it can be in Word documents. The text can be formatted in an Access report. using a bookstore scenario. . A report is an effective way to analyze and present data using a specific layout. To Close an Object: • • Select the tab for the object you wish to close.The final database object is the report.

Ready-2-Read Bookstore The store needs a way to keep track of these things. we will want our database to track the books we sell. At the very least. and we sell books via orders. Determine the Purpose of the Database The first step of designing a database is to determine the purpose of the database. and the date of each of the orders. the customers we sell them to.The Ready-2-Read Bookstore Scenario The best way to learn about designing a database is to jump right into the process. our customers will place orders for books. Plan Database Tables . The following diagram shows that we have customers. Additionally. What do we need it to do? At Ready-2-Read. we can use it to track our sales or to make a bestseller list to post in the store. both in the store and online. Let's pretend we work for the Ready-2-Read bookstore and we need to build a database for the store to use. Purpose of Ready-2-Read Database The database will also be able to tell us where our customers live when we need to send them books or coupons. Let's think about what we might need the database to do for us.

Recall that a table is a collection of records and each record is broken up into the smallest pieces of needed information. called fields. We'll obviously want their first name and last name. Email will be necessary if we need to contact the customer when there is an issue with their order. There will be several fields in our Customers table. the books we have. Let's look at our Ready-2-Read bookstore example again. you can begin brainstorming about how to break the information up into the tables that your database will need to store the data. and the orders our customers place. Tables for Ready-2-Read Database TIP: Keep your database usable to others by giving your tables simple.Once you have established the purpose. the next step is deciding what fields belong in each table. easy to understand names. Planned Fields in Customers Table . Since we are planning a database to track our customers. Remember that fields are the smallest chunk of information in any record. Plan Table Fields Once you know what tables you need. We'll also need an address if we need to send the customer his order. we will need a table for each one of these.

Category will help us know what type of books sell the best. and the Date the order is placed.We will also need several fields in the Books table. Planned Fields in Orders Table Don't worry if your plan doesn't include every possible field you may need. We'll need this table to track the Customer who is placing the order. the Book the customer is ordering. Access lets you add fields to tables any time you think you need another one! Challenge! Imagine you want to use a database at your new coffee shop. so we can order more books that fit into that category. Planned Fields in Books Table The Orders table will have fewer fields. Title and Author make sense for books. We'll need a Price for each book. Plan your database: • • • What would you want to track with your database? What database tables would you need? What fields will be in each database table? .

including establishing what data types can be entered in a given field. Creating a New Database with Access When you launch Access 2007. You will also be setting up the fields for each table. you will see the Getting Started window. You will also see the New Blank Database option that allows you to build your own database from scratch. the template categories including the featured local templates are listed. You will be setting up tables according to the plan for our bookstore scenario. as well as the categories on Office Online. .Introduction Now that we have a handle on what the database should look like. In the left pane. Templates are pre-built databases focused on a specific task that you can download and use immediately. This lesson will walk you through the steps of setting up a database in Access 2007. we need to work on setting up our tables and the fields within those tables.

Rename the database whatever you would like the name to be. Create a New Blank Database . we named the database Ready2Read since that is the name of the store in our scenario. you will be prompted to rename the database from the default name.accdb. In the example below.Getting Started Window When you choose the New Blank Database option at the top of this window. which is Database1.

Click Create to finish naming the database. You will want to name your tables based on your database design plan. Naming Table1 . It also defaults to naming this table Table1 in both the Navigation Pane. and the Table tab itself. you must first click on the Microsoft Office Button in the upper left hand corner of the application. Setting up Tables The new database opens with one table showing as a default. Default Table Name Naming a Table To give the table a unique name.

easy to understand names. Left click anywhere outside of the Table name to make the change. To Rename a Table With the table closed. which means you can now type in the new name right there. New Table Name TIP: Give your tables logical. as you can see in the picture below. select Save from the menu. Rename Table from Navigation Pane The table name will be highlighted and a cursor will appear. right click on the Table you wish to rename in the Navigation Pane. Select the Rename option that appears in the menu. . Save As Dialog Box The new table names appear in both the Navigation Pane and the Table tab itself.Then. The Save As dialog box will appear to let you save the table as whatever name you choose.

You can right click on the Table tab and choose Close from the menu. Close Table from Table Tab A more common method is to click the X that appears in the upper right hand corner of the active database object window. Then. Open Table from Navigation Pane . choose Open from the menu. right click the Table name of the table you wish to open in the Navigation Pane. Close Table from Document Window To Open a Table To open a table.To Close a Table There are several ways to close an active table.

where you are able to set more controls for your fields. Either way. you need to know how to switch between the two views. Naming a Table was addressed on page 3 of this lesson. TIP: You can tell which table you are currently in by seeing which table tab is highlighted. The selected table will open in the active database object window. Create New Table Then. Select the view option you would like from the menu. Access 2007 starts out with one table. To add more tables to the database. select the Views command group from either the Home tab (seen below) or the Datasheet tab on the Ribbon. click on the Create tab on the Ribbon. Adding Fields to a Table Access 2007 allows you to add fields to tables when you are: • • working in Datasheet View. A new table will open in the active database object window. Switching Views To switch views. .A more common method is to double click the table name in the Navigation Pane. select Table from the Tables command group. Adding More Tables to the Database By default. which looks like a spreadsheet working in Design View. You must name your table using the Save command from Microsoft Office menu.

TIP: You may want to rename the ID field with a unique name. Name the field by typing the name directly into the header. This field auto-numbers to give each record in the table a unique number identifier. Access 2007 creates one field in each new table. Automatic ID Field To add more fields to a table in Datasheet View. While this is not necessary.Switching Views Adding Fields in Datasheet View By default. it may help avoid confusion when setting up table relationships. Recall that records are the rows in a table. Press the tab key on your keyboard to move to the next field. double click on the Add New Field header. since the ID field appears automatically in every table you create. Add New Field The Add New Field text will disappear from the header. . the ID field.

your new field appears as its own column. you have many field property options that you can set to ensure that data can only be entered in certain formats.Adding Fields in Design View In Design View. as seen below. When you switch back to Datasheet View. just click in the cell where you want the new field and type the field name. strong data. Moving Fields . the field names are along the left-hand column instead of across the top like in Datasheet View. as seen below. Fields in Design View To add a new field to a table in Design View. Datasheet View of Added Field In Design View. Setting these options is a good idea if you want to make sure the data that you have in your database is good.

Move the mouse in the area of the header. Then. This is found on the Datasheet tab on the Ribbon. When the cross with arrows appears. Release the mouse button and the field appears in its new location. The default Data Type is text for every field after the ID field. just click on the field header and then select Delete from the Field &Column command group. To move a field in Datasheet View. Access 2007 lets you easily move them around. You can change the Data Type setting: • • from the Data Type & Formatting command group on the Ribbon from the Data Type column in Design View From the Ribbon To change the data type from the Ribbon. click on the field header.If you want to rearrange the order in which your fields appear in a table. This is done using Data Type. hold down your left mouse button. select the data type you want from the drop down menu next to the Date Type command. WARNING: You should not delete any field in a table without first knowing what impact the deletion may have on the rest of the database! Setting the Data Type for a Field Access 2007 lets you control how data can be entered in each table field within your database. To do this: • • • • • Click on the field header for the field you wish to move. which was set to auto number. Deleting Fields To delete a field in Datasheet View. drag and drop the field to the location you want. move the cursor to where you would like the field to appear. With the left mouse button still held down. Setting Data Type via Ribbon .

number. click the field name and then press the tab key on your keyboard.In Design View To change the data type in Design View. From the drop down menu under the Data Type column. and created fields for those different tables. you have set up the tables you need for your database. It will cause data to be formatted for currency. text. Setting Data Type in Design View The Data Type is more noticeable when the database is being populated with records. select the format you want. and date/time just in Microsoft Excel. Relationships provide Access 2007 with the means to bring . Challenge! Open Access 2007 and build your own database: • • • • • • • Give Table1 a new name Add a new table Add fields to a table Set the data type for a field in a table Open and close the tables Move a field in a table Delete a field in a table Introduction By now.

o When you are done. You will learn how to read and manipulate the relationship map. Establishing Relationships To establish a relationship between tables: • Click the Relationships command in the Show/Hide group on the Database Tools tab in the Ribbon. Relationships Command • When the Show Table dialog box appears: o Select each table name and click Add for the tables you want to relate. Show Table Dialog Box • You should now see a relationship map that contains all the tables that were selected. relationship types. You will also learn about Primary and Foreign Keys. Close the Show Table dialog box. . and about referential integrity.that information together for you when you need it. This lesson explains how to establish relationships between the tables in an Access 2007 database. NOTE: Tables must be closed in order to establish relationships.

Hold down the left mouse button. Understanding the Relationship Map The relationship map lists all of the tables that were selected to relate. Notice that the first field has a key icon next to it. Release the mouse button to drop the table in its new place.Relationship Map Moving Tables in the Relationship Map To move a table that appears in the relationship map: • • • Place your mouse over the table you want to move. Primary Keys Primary and Foreign Keys . This is the Primary Key for the table. and drag the table to a new location. and all of the fields that were set up for that table previously.

and the primary key for the Books table is Book ID. You may recall that this field auto numbers by default. These fields are the primary key in their own tables. they are considered Foreign Keys. but that shows up in another table. but in the Orders table. Foreign Keys Relating Tables There are a few ways to establish relationships between tables: • • Using the Edit Relationships command located on the Design tab of the Ribbon Using the Drag and Drop method Both methods give you the same end result. Access uses this number to quickly pull information together for you when you run queries or reports. If you look closely at the Orders table. as well as in their own respective tables. the fields Customer ID and Book ID appear there. Relating Tables with the Drag and Drop Method It is easy to relate tables from the relationship map: • Select a field name from one table by holding down the left mouse button.A Primary Key is the first field in each table of the database. In the example above. the primary key for the Customers table is Customer ID. so that every record in the table has its own unique number to identify it. which are covered later. . A Foreign Key is a field that is the Primary Field in its own table. but the Drag and Drop method is much easier and saves you several steps. the primary key for the Orders table is Order ID.

Edit Relationships Dialog Box • • Select the Enforce Referential Integrity option. In the example above. • The Edit Relationships dialog box appears. This option is explained in detail below. we selected the Book ID field from the Books table. Drop the first field name onto the field name that you want to relate by releasing the left mouse button. and dragged and dropped it on the Book ID field in the Orders table.Relationship Map • • Drag the field name from the one table to the other table in the desired relationship. Click Create. .

Understanding Types of Relationships Access 2007 allows for several different types of relationships. because we hope that it gets ordered by many people many times. because that table lists every title that we stock. let's look at one of the book titles in our bookstore. Selecting this option tells Access to check for these things when someone is working with your data records. For example. These include: • • • One to One One to Many Many to Many The relationship type you will come across most frequently. But it will probably appear many times in the Orders table. is the One to Many relationship. but many times in the related table. . The Book ID for that book should appear only once in the Books table. One to Many The One to Many relationship means that data for that field will show up a single time in one table. You should click Enforce Referential Integrity to make sure that we NEVER have an order for a book that doesn't appear in our Books table. an option to Enforce Referential Integrity appears. The symbols for the One to Many relationship look like this: One to Many Relationships Enforcing Referential Integrity In the Edit Relationships dialog box. and the one created in our bookstore scenario.

This can be done using the Edit Relationships command on the Ribbon. Adding and Editing Data in Tables . However. You can add. It will also discuss the dangers involved in deleting records from a table and the importance of setting validation rules and other field properties and to ensure that data is valid. a much simpler way is to simply double click on the link that appears in the relationship map. save the sample Ready2Read database on your own computer. Establish a relationship between the Customers table and the Orders table using the Edit Relationships command on the Ribbon. • • • • • Open the database and establish a relationship between the Books table and the Orders table using the Drag and Drop method. Challenge! If you haven't already done so. where you can change your settings. edit. Either method brings up the Edit Relationships dialog box. Move the tables around in the relationship map. Edit an established relationship by double-clicking the link. Explore the options and settings in the Edit Relationships dialog box.Editing Existing Relationships Access 2007 allows you to edit relationships that already exist. and delete records directly from these tables. as well as how to edit existing records using commands like Copy and Paste and Find and Replace. This lesson will show you how to work in the tables to add new records. Entering and Editing Data in Tables 1 of 5 Introduction Access 2007 databases hold the actual data records inside tables.

New Record Row • • Type the data into the appropriate fields. you can do this a few different ways. The navigation bar is located in the bottom left corner of the open object pane.Watch the video! (10:10min) . To Add Records with the New Record Navigation Button: • Click the New Record button in the navigation bar. Hit Enter or the Tab key to move to the next field. you are populating the database. Download the example to work along with the video. New Record Navigation Button . In Access 2007. To Add Records in the New Record Row: • Click the record row with the asterisk that appears at the bottom of the table. Adding Records to Tables When you enter records into your table.Tips for watching our videos.

Hit Enter or the Tab key to move to the next field.• • Type the data into the appropriate fields. To Add Records with the New Record Command: • Click the New Record command in the Records group in the Ribbon. Like with every other task in Access 2007. this can be done several different ways. Hit the Enter or the Tab key to move to the next field. To Edit a Record Directly: • Scroll through the records or use the Navigation Buttons in the navigation bar to find the record to edit. Editing Records in Tables Sometimes it is necessary to edit records in the database. A pencil icon appears to indicate edit mode. New Record Command • • Type the data into the appropriate fields. . Navigation Buttons • Click the cell that contains the information that must be edited.

Find Command • The Find and Replace dialogue box opens. Find and Replace Dialog Box • • Tell Access what to find by typing it into the Find What: area.Edit Record Mode • • Type the new information into the field. Click outside of the record row to apply the change. . Type the replace term in the Replace With: area. To Edit a Record using Find and Replace: • Click the Find command in the Find group on the Ribbon.

overwriting what is currently there. o Use Cancel to stop the edit process. The record information appears. Then right click and select Paste. A dialog box appears. Click on one of the action options: o Find Next will find the next instance of the word in the table. the whole field. Right click and select Copy. the drop down is the field you were last in in the table. as it will overwrite every instance of the Find term in the table. Delete Record Dialog Box There may be other records that rely on the record you are trying to delete. which can have a serious impact on your data. Tip--The first choice in. Select the new record row. Tell Access what to Match: Any part of the field. . CAUTION: DO NOT use Replace All . o Replace will put the new word into the table. Down finds records below the cursor. DO NOT delete a record without knowing how it will impact the rest of your database.• • • • Tell Access where to look with the Look In: drop down list. To Copy and Paste a Record: • • Select the record that you want to copy. Then. Tell Access how to Search: Up finds records above the cursor. and All searches all records. telling you the action can not be undone and asking if you are sure you want to delete the record. right click and select Delete Record. To Delete a Record: • • Select the record that you want to delete. with a new record ID number. or just the start of the field.

Access 2007 allows you to set field properties and data validation rules. Now. or valid. 2008 in the month/date/year format. if the database is tracking all sales for the month of January 2008. For example. like the one below. and then add a new record. your new record numbers will appear to be out of sequence. even though both were placed on the same date. it may not show both orders as placed in January. as 01/04/2008. Access will not accept an invalid format and will display a validation error. if a field data type had been set to Currency and a text value is entered in that table field during data entry. Data Validation Data Validation is a very important database concept.Record Numbering after Deleting Records When you delete a record. . as 04/01/2008. It is the process by which Access tests the data that is being entered into the database. Imagine that one of your database users has entered an order date of January 4. to force the person entering data to follow a specific format. to make sure it is in an acceptable. Data Types and Validation Rules Data Validation begins when data types are set during the process of building tables and fields. format. that record number is permanently deleted from the database table. If you delete the last record from a table. Another user has entered an order placed on that same date in the day/month/year format.

highlight the field that requires a validation rule. Setting Data Validation Rules • • In Design View.Data Validation Error Message Data validation is accomplished by setting data validation rules and other field properties for various fields. In the Field Properties section at the bottom half of the window. set your validation rule using the Expression Builder. Use Expression Builder to Enter Validation Rule . The expression builder offers common syntax to set up a data validation rule.

To set the Validation Text. For the validation rule that we set for Category. Rules for text fields require you to enclose each acceptable value inside its own quotation marks. separating them with Or. Validation Text Validation Text is a specialized error message that you can set to have Access tell the person entering data the specific way you would like them to enter it.Validati on Rule for Category Field Validation rules work most easily with numeric fields. you would set the validation text like this: Validation Text for Category Field . enter the error message exactly as you want it to appear to your user in the row directly beneath the Validation Rule row in the Field Properties section of Design View. as seen above.

Copy and Paste a record in one of the tables Set a validation rule and validation text for a field in one of your tables. the field size could be set to 2 to ensure that no one enters a full state name into this field. If you were using a text field to hold the two letter state postal abbreviation. Creating and Using Forms 1 of 6 Introduction . percentages. and add records using the new record navigation button Add a record using the New Record command in the Ribbon Edit a record using the Find and Replace command. Format. and Required. Then. Choose No if the person entering data is allowed to leave the field blank. Set the Required property to Yes if you want the person entering data to be required to enter something in the field. • • • • • Open the database. The Format field property can be set to display text or numbers in a standardized way. • • • Field Size can be set to hold a specific number of characters. For example. save the sample Ready2Read database on your own computer.The following image shows the resulting error message that the user would see when they have broken the Category validation rule: Error Message Showing Validation Text Using Field Properties to Ensure Data Integrity Another way to ensure data integrity is by setting field properties such as Field Size. break the rule when entering data and see the resulting message. or decimals. up to as many as 255 for text fields. These are just some ways Access helps you ensure that data being entered into your database is valid. text can be set to show as all uppercase and numbers can be set to show scientific numbers. Challenge! If you haven't already done so.

a form is piece of paper that you fill out so that someone can collect and keep track of specific information about you. It will also show you how to set up a basic form for your Access 2007 database. This lesson will address the benefits of using forms with a database. your record. and will show you how the person entering data will use the form to populate or edit data in the database. Only one record. is captured with any given paper form.Another way to populate a database is with the use of forms. Why Use Forms? In real life. Creating and Using Forms 2 of 6 Creating and Using Forms Watch the video! (Part 1) (3:18min) (Part 2) (6:35min) . Download the example to work along with the video.Tips for watching our videos. Common Form . You will also learn how to enhance a basic form with a drop down list. An Access 2007 form helps the person entering data know exactly what information to enter.

a table can be overwhelming to the person entering data. the lower the chance that the data can become compromised.like a drop down menu -. Access Form An Access 2007 form also lets the person entering data know exactly what information to enter. These tools are located in the Forms group on the Create tab in the Ribbon. Corrupt data is not useful! Forms are one more way that the database owner can limit the actions of the other users. If the database has hundreds of records and many fields to populate for any given record. An Access form lets your user enter data one record at a time. Form properties can be set so users can only enter records or only view records. A database owner wants to control the levels of access that other database users have to the data -because the fewer people that are interacting with the data.can dramatically increase the integrity of the data that is held in a database. In previous lessons. as seen below: Forms Command Group The Access 2007 forms tools include: . you saw that you can populate a database by entering records into the tables themselves.Access 2007 forms work very much the same way. and can even tell him what that information should look like. without having to see the entire table. Adding certain control components to a form -. Creating and Using Forms 3 of 6 Creating a Form Access 2007 has several automatic tools for creating forms.

The Split Form command creates a form showing one record on top. It walks you through the process of creating more customized forms. also. because it allows the person entering data to see just one record at a time.• • • • The Form command makes a basic form. The Navigation Bar is located in the bottom left of the object pane. With the source table highlighted. Creating and Using Forms 4 of 6 Using Forms to Enter Data Populating a database is easy once you have a basic form in place. select the Form command from the Forms command group in the Create tab on the Ribbon. Record navigation works the same way for forms as it did for tables. To create a form using this command: • • • Begin by highlighting the table you wish to use as a source table. The new form is created and opens in the object pane. The Multiple Items command creates a form that shows all the records at once. showing a single record at a time. . The Navigation Buttons work the same way they did for the tables. The newly created form has the same name as the source table by default. The following picture shows the navigation buttons for a form. To Create a Form using the Form Command The basic Form command is the one we suggest. You will be prompted to give the form a name. and you can modify the layout of the basic form to hide fields or add controls. The Form Wizard is hidden under the More Forms command. You can give the form a new name by saving the form. It also includes all the fields in your source table for you. which looks very similar to the source table in datasheet view. and includes the datasheet view of entire source table on the bottom.

it may be necessary to refresh the table in Datasheet View to see the newest record. or the New command in the Records group on the Ribbon. The acceptable formats were established when the field properties were set. To Edit Records using a Form . or by progressing to another record using the New (Blank) Record navigation button. Then. you must save the record. either by using the New Record navigation button. simply add the new data. Your data must be entered using an acceptable format. Save by using either the Save command on the Ribbon. Moving to a new record saves the most recently entered record.Form Navigation Buttons To Add a Record using a Form To add a record to the database using a form: • • Navigate to a new record. However. • Finally.

because drop down lists force the form user to select one of the pre-set options in the list to populate the field. .Just like in a table. This command works exactly the same way for a form as it does in a table. To Create a Drop Down List using a Combo Box Control • With the form opened in Design View. These types of form controls are relatively easy to set up using the Combo Box. select the Combo Box command in the Controls group on the Design tab in the Ribbon Combo Box Command • Drag and drop the Combo Box sizing tool to create the Combo Box where desired on the form. the database user can edit records from a form using the Find and Replace command. Creating a Drop Down List Using a drop down list on a form can increase the integrity of the data in the database.

and click Next.Combo Box Sizing Tool • The Combo Box Wizard appears. which asks for the values to be typed into a small table. . Combo Box Wizard • • Choose the desired option from the Wizard. Because the middle option was selected in the example above. the Wizard progresses to the next step.

Use the drop down list to select which field Access should use to store the values. This label may be deleted.Combo Box Wizard • Next. click Next. the Wizard asks what to do with the entered values. Access can either remember the values for later use. Finally. Whatever name is entered will appear as a label on the form. Combo Box Wizard • • Once the desired option has been selected. or can populate a field with the entered values. give the Combo Box a name and click Finish. the Wizard gives the Combo Box a generic name. If you choose. . if desired. which may be meaningful to you later if there is ever a need to adjust the properties of this or another Combo Box.

Books Form Drop Down Category List Challenge! If you haven't already done so.99 o Title: Cars and Trucks Author: Jonathon Bradley Category: Kids Price: $14. save the sample Ready2Read database on your own computer.Switch to Form View to see how the Combo Box works. Use the new Books form to enter and save the following data: o Title: The Secret Streets of Savannah Author: Amy Little Category: Travel Price: $34. Create a basic Books form using the Form command. as seen below. create a drop down list on the Books form for the following Categories: o Fiction o Non-Fiction o Kids o History o Technology o Home & Garden o Travel . • • • • Scroll through the customer records using the Customers form. The Category drop down list appears on our Books form.99 Using the Combo Box command.

which was created with the Form command. The basic form. Making Forms More Usable You already know that forms can help you increase the integrity of your data by limiting what your user can see and how they can enter data. In Access 2007. at the same time. Use the Find and Replace command to change the price of all books that are $14.99.• • Food Add another record to the database using the Books form with the drop down Category selector. It will also walk you through hiding fields on a form and adding command buttons to the form. Let's look at the Orders form in our bookstore scenario. Download the example to work along with the video. increase the integrity of the database. looks like this: . Making Forms More Usable Watch the video! (10:04min) . Now it is time to think about the design of your forms from your form user's perspective. o Making Forms More Usable with Controls 1 of 8 Introduction You have already seen how a Combo Box control can make a form more user-friendly.99 to be $16.Tips for watching our videos. This lesson will explain how to use form properties to limit the actions your form user can take. there are several other ways you can modify forms to make them easier to use and. You saw that using a drop down list can make data entry easy.

Setting Form Properties Access 2007 allows you to set many form properties. not editing existing ones. and interacts with the rest of the database. the store employee. like the one shown below. We will set field properties to make this happen. to pair a customer with a book to complete an order. . The Customer ID field and the Book ID field are not very useful as they are. Our user will not need to enter the Order Date. because we want the database to autopopulate this field in the database using today's date. The user will also never need to enter the Order ID number. works.Orders Form This form is where we would want our user. We will set form properties to limit this action. because our employee would have to know each customer's ID number and every Book ID number to be able to enter the data in the format we need. These options control how the form looks. Form properties are options that are set in Design View on the Property Sheet. We will hide this field. as this is the number that the database assigns each order record to differentiate it from other orders. Let's look at this form from our user's point of view: • • • • Our employee would be adding new orders. We will make these fields more usable by creating Combo Boxes that help our user select the correct customer and book.

Property Sheet To Set Form Properties To set properties for your form: • • View the form in Design View. Select the Property Sheet command from the Tools group on the Ribbon. . • When the property sheet opens: o Make sure Form is selected in the Selection type drop down list o Set the desired form properties. Note: The form Property Sheet is also accessible by right clicking anywhere on the form in Design View and selecting Properties from the menu. as seen above.

Change the Visible property setting to No. To hide a field: • • In Design View. as seen below: . open the Property Sheet. Use the help that Microsoft Access 2007 offers you in the bottom left corner of the Access window to know what each property setting does. To Hide a Field on a Form Hiding a field makes it invisible on the form when it is viewed in Form View.Setting Field Properties with the Property Sheet Tip: Use the tabs to find the specific property you wish to set. Access 2007 allows you to hide fields by setting the Visible field property in Design View. Hiding Fields on a Form There will be times when a field will not be needed on a form.

as seen below: New Orders Form with Drop Down Lists . Creating Combo Boxes For the New Orders form in our bookstore example. we created user-friendly drop down lists using the Combo Box command.Visible Property Setting • Switch to Form View to verify that the field is hidden. These drop down lists help our user identify a specific customer and a specific book using more useful information than the Customer ID and Book ID numbers.

Open the Property Sheet. because the form will do it for him. Setting Field Properties Sometimes. New Orders Form To Set Field Properties from a Form To set a field property for a form. In our example. Refer to the picture below. we have Order Date showing in the Selection type drop down list. For example. on the New Orders form for our book store shown below. On the Property Sheet. Set the desired field property. Notice that we have the Order Date field highlighted on the form itself. we want to set the Order Date field to auto-fill with the current date. in Design View: • • • • Highlight the appropriate field on the form. .The process for creating combo boxes is covered in Lesson 7. it may be necessary to set field properties from the form itself. our employee will not have to worry about entering a date on the form. This way. Verify that the Field Name appears in the Selection type drop down list. we want to set up the Order Date field to auto-fill with the current date each time an order is entered.

we have to set the default value to always enter the current date.Setting Properties for Order Date on the New Orders Form Because we want the Order Date to auto-fill. . To Set a Field to Auto-fill with the Current Date To set the Order Date field to automatically enter the current date in our database: • Open the Data tab on the field's Property Sheet.

Explore them by clicking on the various files in the left hand column. . It looks like this: Expression for Current Date The Expression Builder contains many commonly used expressions for database functions. Use the Expression Builder to enter the expression for the current date.Setting Order Date to Auto-fill with Current Date • • Set the Default Value property by clicking on the Expression Builder button.

These command buttons are grouped into categories of actions.offer the user a quick way to do things such as preview or mail a report To Add a Command Button to a Form To add a command button to a form: • Click the Button command in the Controls group on the Ribbon.let your user do things like save or print a record.give your user the ability to quickly open or close a form. including: • • • • Record Navigation command buttons -. and other actions Report Operation command buttons -. Form Operation command buttons -. print the current form. Button Command in Controls Group • When the Command Button Wizard opens: o Select the type of command you want from the Categories list. . Record Operation command buttons -.easily allow your user move among the records in your database. o Select the specific action you want the command button to perform from the Actions list. Command buttons are a quick way for your form user to take a specific action. o Click Next.Creating Command Buttons Another way to make a form more user-friendly is by adding command buttons to the form.

select one using the Browse button. Command Button Wizard Step 2 • In the next Wizard step: o Give the button a meaningful name. o Click Next. . enter it in the Text box. o If you want a picture to appear on the button.Command Button Wizard Step 1 • In the next Wizard step: o If you want text to appear on the button.

Command Button Wizard Step 2 Access will give your button a default name. save the sample Ready2Read database on your own computer. Renaming it with a more useful name may help later if you have several buttons on a form and wish to change the properties of one. The command button should be operational and appear on the form in Form View. Set the Order Date field property to have a Default Value of the current date. • • • • • • Open the Orders Form and change the form properties so that it limits the user to adding records only. Hide the Order ID and Order Date fields. Making Forms Attractive Introduction . making sure they contain helpful information for your user and correctly populate the database with the ID numbers. Add a command button to the form. Challenge! If you haven't already done so. o Click Finish. Create drop down lists for the Customer ID and Book ID field.

you may want to make the forms more visually appealing. it is time to think about what a form looks like. . Select Layout View in the Views group on the Ribbon. In Layout view. in the header area of every form that you create.Now that you know how to make forms work better for your user. These types of changes are done to the form in Layout View. select Layout View from the list. as well as moving and applying borders to objects. To Switch to Layout View There are three different ways to open the form in Layout View: • • • Right click on the form tab or on the form name in the object list. and for changing the font. and borders on the form. including how to add a logo and apply an Auto Format to the form. Making Forms More Attractive Watch the video! (3:34min) . It will also cover using and formatting titles. Download the example to work along with the video. like the one below.Tips for watching our videos. you see the form as it will appear to the user in Form View. Click on the Layout View icon in the bottom right hand corner of the Access 2007 window. Then. colors. This lesson will address the various ways to modify a form layout. so it very useful for setting the size of controls and other objects on the form. Adding a Logo Microsoft Access 2007 automatically puts a form icon. Making Forms More Attractive Since other people will be using the forms in your database to enter data.

click Ok. Applying a Style with AutoFormat .Form Icon One way to customize the look of your forms is to remove that icon and replace it with a logo. The new logo should appear. as well. Logo Command • Use the Insert Picture dialog box to locate the picture file you wish to use as the logo. Moving and re-sizing objects on a form is covered later in this lesson. Then. This is very easy to do using the Logo command. Select the Logo command from the Controls group on the Ribbon. To Replace the Icon with a Logo To replace the form icon with a logo of your choice: • • Delete the form icon. You can move and re-size the logo.

AutoFormat Options Working with Titles One of the easiest things to change on the form is the title. but Microsoft Access has already combined colors in several attractive styles. You could modify the color for each part of the form on your own. Select the desired format. To Change the Form Title To change the form title: • Click the Title command in the Controls group on the Ribbon.Another simple way to dramatically change the way your form looks is to apply a style with the AutoFormat command. The change will appear when the mouse button is released. These styles are available under the AutoFormat command. . To Apply an AutoFormat To apply a pre-set format to the form: • • Click on the AutoFormat command on the Ribbon. which appears in the form header with the icon or logo.

or underlines to the text. allows you to change the font style. Changing Text on the Form Access. Text Formatting Commands . It also lets you apply bold. like all Microsoft Office 2007 products.Title Command • When the title highlight appears. as seen in the following diagram. Note: The title does not affect the name of the form and vice versa. type the new title and hit the enter key on your keyboard. italics. text size. All of this is done from the Ribbon. text color and alignment.

To Modify Text
To make changes to the format of the text on a form:
• •

Highlight the text Apply the desired format by doing one or more of the following: o Select the desired font style from the Font face drop down list. o Set the size of the text using the Font size selection list. o Choose a color for the text using the Font color selector. o Apply either the bold, italics, or underline style.

Additional text formatting options are available in the Font group. The above list includes the most common text modifications.

Working with Objects on a Form

Other ways to modify the way a form looks in Access 2007 include re-sizing and re-positioning the objects that appear on the form, as well as applying borders to objects on the form. All of these tasks are easily done in Layout View.

To Move Objects on a Form
To move an object to another place on the form:
• •

Highlight the object by clicking on it. Move the object by dragging and dropping it in a new location.

To Re-size Objects on a Form
To change the size of any object on the form:
• • •

Highlight the object by clicking on it. When the cross hair cursor appears, hold down the left mouse button and drag the edge to the preferred size. Release the mouse button to apply the change.

To Apply a Border to Objects on a Form
Borders can make an object more visible to your form user. To apply a border to any object on a form:

Highlight the object by clicking on it.

• • •

Select a width using the Line Width command. Select a style using the Line Style command. Select a color using the Line Color command.

Border Commands

Challenge!
If you haven't already done so, save the sample Ready2Read database on your own computer.

Open the Orders Form in Layout View and change the form by: o Adding a picture using the Logo command. o Giving the form a new Title. o Modifying some of the text on the form. o Applying one of the AutoFormat options. o Moving or resizing an object on the form. o Applying a border to an object on the form.

Sorting Records
1 of 5

Introduction

Once a database is populated, it is time to think about how to look at, or analyze, the data. One very basic way to analyze data is to sort it. Sorting data is easy with Access 2007. This lesson will show you how to sort text-based and numeric data using common sorting commands. It will also show you how to clear sorts.

Sorting Records
Watch the video! (3:34min) - Tips for watching our videos.

Download the example to work along with the video.

Sorting Records
Sorting is probably the simplest way to look at data; it keeps like things together. In our bookstore database, for example, we could sort our data a number of ways:
• • •

We could sort orders based on the order date. We could sort our customers by the state in which they live, or by their zip codes. We could sort our books by author, category, or price.

Access 2007 allows you to sort the records in your database tables based on a field or value that is either text (like author's last name) or numerical (like a customer's zip code or a book's price). Depending on the type of value, Access offers different sorting options.

Sorting on Text Values

When Access 2007 sorts on a text value, it offers the two options described in the table below:

as seen below. the records will be sorted based on the chosen field's value with the value closest to A at the top of the table. Sorting A to Z • When the menu appears. . o With A to Z. select either the Sort A to Z or the Z to A option.Sort Option A to Z Z to A Also Called Ascending Descending Description Values closest to A are displayed first Values closest to Z are displayed first To Sort Based on a Text Value To sort based on a text value: • Click the drop down arrow at the top of the field you wish to sort.

Records Sorted A to Z on Category

o

With Z to A, the records will be sorted the using the chosen field's value with the value closest to Z at the top of the table.

The sort commands in the Sort group on the Ribbon is another way to begin the sort.

Sorting on Numeric Values
Access 2007 also offers the two options when sorting based on a numeric value. These options are described in the table below:

Sort Option Smallest to Largest Largest to Smallest

Also Called Ascending Descending

Description Values closest to 1 are displayed first Values furthest from 1 are displayed first

To Sort Based on a Numeric Value
To sort based on a number value:

Click the drop down arrow at the top of the field you wish to sort.

Sorting Largest to Smallest

When the menu appears, select either the Lowest to Highest or the Largest to Smallest option. o With Smallest to Largest, records will be sorted based on the chosen field's value with the value closest to 1 at the top of the table. o With Highest to Lowest, records will be sorted the using the chosen field's value with the value furthest from 1 at the top of the table, as seen below.

Records Sorted Largest to Smallest on Price

The sort commands in the Sort & Filter group on the Ribbon can be use to begin the sort, as well.

To Clear a Sort

To clear your sort:
o

Click the Clear Sort command in the Sort & Filter group on the Ribbon.

Clear All Sorts Command

Challenge!
If you haven't already done so, save the sample Ready2Read database on your own computer.
• • •

Open the Customers table and the Books table. Sort the Last Name field in the Customers table from Z to A. Sort the Books table according to Price using the Lowest to Highest option.

Method Filter by Field Description Lists all of the values that have been entered in a specified field. Introduction Another useful way to look at. then displays only the records that contain those specified values and criteria. You will also learn how to use the toggle button to switch between filtered and unfiltered results. and to perform advanced filters. Filtering Records When you tell Access 2007 to filter your records. Download the example to work along with the video. Filtering data is easy with Access 2007.Tips for watching our videos. so that you can choose which value or values you want . or analyze. you are asking it to: • • • Search all the records in one table Find every record in that table that meets the criteria you set Display the results for you in the table by hiding the records that do not meet the criteria You can filter data using what Microsoft calls the Filter by Field and Filter by Selection methods. Access 2007 can perform an Advanced Filter. the data in the database is by filtering it. Filtering Records Watch the video! (7:10min) . These options are described in the table below. which is really a small query that is run on only one table.• Clear your sorts. to save the filtered results. Filtering groups your data together based on one or more criteria for a given field. This lesson will show you how to filter records using common filter commands. and more. Additionally.

In the example below. Once you choose which value to filter by. Access returns the results to you as a subset of records in the table. Access lists all these values for you. It looks like a funnel. . click on the Filter command. In the Sort and Filter group in the Ribbon. To Filter by Field To Filter by Field: • • Highlight the column for the field you want to use as a filter. Access 2007 finds all of the values that have been entered in the specified field. Filter by Selection Offers the ability to search records based on the value that is currently selected in a table. we are filtering using the State field. Filter by Field When you Filter by Field. You can ask it to find records that: • • • • Equal the value Do not equal the value Contain the value Advanced Filter Do not contain the value Narrows filtered results further by performing additional filters or sorts.Access to find. so that you can choose which value or values you want Access to find for you within that field.

However. o Checking Blank will find only records in which the field is empty. clicking on this option when the all values are checked will clear the selections. select the value that you want to use as the filter value: o Checking Select All will return every record in the table. Results for Filter by State for NC Customers . o Check as many of the values as you would like to see returned in your results.Filterin g by Field • • When the dialog box appears. Click OK.

In the example below. this option would return records for the city of Raleigh only. choosing Contains would return records with a city value of Raleigh. or Raleighville. you can toggle between your filtered results and unfiltered tables in a variety of ways: • • Use the label that appears in the navigation bar. In the example below. Caraleigh. In the example below. this option would return all records except for the ones with Raleigh as a city. When the list appears. In the example above. Access 2007 returns the results to you as a subset of records in the table. o Does Not Contain will not return records with the selected value anywhere within the search field. the results are showing all records for customers living in NC. clicking Does Not Contain would return all . To Toggle Between Filtered and Unfiltered Results As with most actions in Access. To Filter by Selection To filter by selection: • • • Place your cursor in the cell that contains the value you want to use as your filter value. In the example below. as seen above. but that the table name is still Customers. o Contains will return every value that has your selected value somewhere in it. Notice that all other records are hidden from view. choose one of the options: o Equals will return all records that have exactly the same value as your selected value. o Does Not Equal will return every record that does not have the same value as your selected value. or criteria. Use the Toggle Filter button on the Ribbon Toggle Filter Button Filter by Selection When you Filter by Selection. It assumes that your current selection is what you want to use as your filter value.The results will appear in the table. Click on the Selection command in the Sort & Filter group in the Ribbon.

and can even save your results as a query so you can use them again later. An Advanced Filter can really help you narrow down your records.Raleigh. From the menu that opens.records except for records that have Raleigh in the city name -. would not show up in the results. Another way to do the same thing is to use the Advanced Filter command. To Apply an Advanced Filter To apply an Advanced Filter to your table: • • Click on the Advanced command in the Sort & Filter group in the Ribbon. Filtering by Selection of Raleigh Sorting or Filtering the Filtered Results Access 2007 lets you narrow the filtered results even more by applying another level of sorting or filtering. It uses a screen very similar to the query design screen. select the field or value you wish to use as the basis for a deeper sort or filter. North Raleigh and Raleighville. . To do this: • • In the table showing your filtered results. Apply the additional filter or sort. for example. Queries are covered in more detail in other lessons. Advanced Filters An Advanced Filter is very similar to a multilevel sort in Microsoft Excel. select the Advanced Filter/Sort option. This is like running a miniature query on only one table.

showing that it is searching for that exact value. Your filtered results will appear in a new table. Access will perform the filter functions. You can save the advanced filter. To view the results. based on the order displayed on the Advanced Filter design screen.• The design screen will open so that you can set up your filter criteria and/or sorting order for the various fields in the table. Once all the sorts are completed. Access will put quotation marks around your criteria. Access filters from left to right.  Choose the sort option you want to use from the drop down list that appears. Like the sorts. . o To filter the new field:  Click in the Criteria cell for the field. according to the way they are displayed on the Advanced Filter design screen. in the event that you may want to run it again later. drag the field name from the table at the top of the screen to the design portion of the screen in the bottom half of the window.  Enter your criteria by directly typing it into the cell. click on the Toggle Filter button on the Ribbon. Advanced Filter Design Screen • To sort or filter another field. Then: o To sort the new field:  Click in the Sort cell for the field. Important: Access will perform the sorts left to right.

• • Use the Filter by Field method to filter the Customers table to find all customers from NC. This dialog box will only appear the first time you save.To Save the Advanced Filter To save the Advanced Filter: • • Right click on the Advanced Filter design tab. because they are very simple queries run on only one table. Select Save. Challenge! If you haven't already done so. save the sample Ready2Read database on your own computer. Hint: Use the Does Not Equal option. • • • Practice toggling between the filtered results and the unfiltered tables. you must give the advanced filter a name. sorted on price with the highest price first. Save your Advanced Filter with whatever name you choose . Use the Filter by Selection method to filter the Customers table. Access 2007 saves Advanced Filters as queries. Saving an Advanced Filter • If the Save as Query dialog box comes up. looking for all NC customers NOT in Raleigh. Apply an Advanced Filter on the Books table to find all the Kids books.

Using Queries Queries retrieve information from one or more tables based on a set of search conditions that you set up and then combine that information in a way that is easy for you to analyze. If you have used an Advanced Filter in Access 2007. Queries allow you to retrieve information from one or more tables based on a set of search conditions you define. Otherwise.Tips for watching our videos. you will need to use either the Query Design command or the Query Wizard. This lesson will explain how to plan a query using a three-question planning process.Using Queries to Make Data Meaningful . you may not get the results you expect. Using Queries . Download the example to work along with the video. You will learn how to use the Query Design command to run the query.Part 1 Watch the video! (5:22min) . though. Before using the Access 2007 query tools. it will show you how to save the query for later use. as well as how to modify the query to hide fields or other information in your query results. Finally. Access 2007 will display your results in their very own table that you can analyze and manipulate further. it is important to plan out the query using a logical process.Part 1 1 of 7 Introduction The real power of an Access 2007 database is in the ability to pull data for quick analysis. Planning a Query . If you want to pull data from more than one table. which is what happens when you run a query. then you have already run a very basic query on only one table.

for this query we'll need: o Customers table . What conditions do you want the data to meet? This helps determine how to set the criteria so Access can search the records properly.to know which customers ordered those books. . What is the condition we want the data to meet? We want Access to look for only the books where the book's category is technology.to know which books are technology books o Orders table . • What fields do we want to see in the results? We need a list of customer names and addresses in order to mail the coupons to our customers. so we'll need the results to show: Fields in Results • • In which tables is the information stored? Well.There are three questions you need to answer when you are planning a query: • • • What do you want the results to look like? Identify every field or bit of information that you want included in the results. A query can help us answer the question: which customers have ordered technology books from us already? Let's use the three-question process to plan this query. and we want to send coupons to customers that have ordered technology books from us in the past. Where is the information stored in the database? List which tables (and/or queries) hold the information that you want to see. Planning: Which Customers Ordered Technology Books? Let's think about this process for our bookstore database scenario.to get the customers' names and addresses o Books table . We have new technology series coming out soon.

. Our plan called for all three tables. you can build and run it using Access 2007's query tools.Criteria of the Query Condition Using the Query Design Command Once you have planned out your query. To Build a Query using the Query Design Command To build and run a query using the Query Design command: • Select the Query Design command from the Create tab on the Ribbon. Query Design Command • Use the Show Table dialog box to select which tables (and/or queries) to include in the query.

.Show Table Dialog Box • Drag and drop the fields you want to see in your results to the bottom portion of the query design screen.

Access 2007 puts quotation marks around the term to show it is looking for exactly that term within the designated field. Once the condition is set. • Run Query Command • Finally. As seen above.Add Fields to Query Design Screen • Enter the condition in the Criteria row for the condition field. click Run! in the Results group on the Ribbon. we typed Technology in the cell labeled Criteria for the Category field. . view your results to determine if they match your desired results. For our query.

Customers of Tech Books Query Results Hiding Fields or Other Information in the Results Sometimes the results of a query will include information that is seemingly unnecessary to you. de-select the Show option by clicking on it. Show/Hide Field . To Hide Part of the Query Result To hide a field in your query results: • In the query design window. Access 2007 allows you to easily hide these fields.

When the Save As dialog box opens. Challenge! . when you run your results. Saving a query is very easy to do. you may want to keep it to run again later or to modify it slightly. Query Results with Category Field Hidden Saving the Query Sometimes you will not need to save your results or your query design. that field will be hidden. as seen below. give your query a meaningful name. To Save a Query To save the query for later use: • • Right click on the query tab. The query will now be listed in the object list on the left side of the Access window. Saving the Query • • Click OK. Other times.• Now.

Perhaps the easiest of these is the Totals command. These functions include: • • • • • Sum -.Part 2 Watch the video! (4:45min) .Part 2 2 of 5 Using Queries . Use the Query Design command to set up the query. Minimum -. Run the query and view your results. Average -. Using Totals in a Query Sometimes.used to count the number of same values in a query.used to find the average of a column of numbers. save the sample Ready2Read database on your own computer. Modify the query to hide a field. Download the example to work along with the video. . Introduction You already know how to plan and run a basic query.returns the highest value in a field.returns the lowest value in a field. Using Queries to Make Data Meaningful .used to add a column of numbers. Save the query.Tips for watching our videos. you may want to see your query results grouped or counted in some way. This lesson will show you how to run a query that includes a Totals function to group and count the records in the results. whose optional functions are very similar to the functions used in Microsoft Excel. Access 2007 offers several options that make these functions possible. Count -. • • • • • Plan a query to find out which customers order a certain category of books. It will also deal with ways to further sort and filter via your query design to refine the results even more.If you haven't already done so. Maximum -.

One of the most useful Totals functions to use in queries is the Count function. Take our bookstore database for example. . If we run a query to see the information for every book that has been ordered. so they appear as one record. Access will automatically group every field by the values in each field. To do this. Using Count and Group By in a Query When you use the Totals command in a query. we'd get a list that looks like this: Query for Ordered Books Notice that we get a record back for every order of each book that has been ordered. rather than as many records. we use the Count and Group By options. In our bookstore example query. This is called the Group By function. To Use the Count and Group By Options in a Query To include the Group By and the Count functions in a query: • Click on Totals in the Show/Hide group on the Ribbon. we want to see these titles grouped together. This just means that it will look for repeating values and group the like values together. so that we see each ordered titles only one time.

We want to count the number of times the same Book ID appears in the Orders table.Totals Command The Total row will instantly appear in the bottom portion of the query design screen. click in the Totals row for the field you wish to count. with an extra column that indicates the number of times this Book ID appeared in the Orders table. author. select Count. Total Row in Query Design • • Next. price and category is now listed only one time for each book. . Total Options in Query Design • Click Run! to see your results. From the list of optional Totals functions. Notice that each title.

or by applying the sort and filter in the query design itself. To Sort via the Query Design To add a Sort to any field in the query design: • Click on the Sort row for the field you wish to sort. o Descending will show the results with the highest numerical value or the text value furthest from A first.Count and Group By Functions in Query Results Sorting and Filtering Query Results Once you have the results looking how you want them. This can be done using the methods of sorting and filtering covered in Lesson 10 and Lesson 11. you can sort and filter them to narrow your results down even further. . A drop down list will appear: Sorting via Query Design • Choose one of the options: o Ascending will show your results sorted with the lowest numerical value or the text value closest to A first.

Run the query and view your results. Challenge! If you haven't already done so.• (not sorted) will keep your records grouped. Click Run! to see the results. as well as . but not sort them. Modify a query design to include filter Criteria. Add your filter criteria by typing the value in the cell. This lesson will show you how to create a report using the Report command. Save the query. Save the query. save the sample Ready2Read database on your own computer. o To Filter via the Query Design To add a filter to your query design: • • Click the Criteria row in the query design. It will also show you how to use grouping options and query limits to make the report easier to read. as we did in the following example: Filtering via Query Design • Click Run! to see the results. Introduction Now that you know how to use queries to analyze the data in a database. it is time to find out how to create a report that will make the data meaningful to someone else. Modify a query design to include a Sort Run the query and view your results. • • • • • • • Create a query that uses the Count and Group By options.

you need to share that data with someone else. or just highlight the table name in the Navigation Pane. Using Reports To Make Data Meaningful to Others As you know. Using Reports To Make Data Meaningful to Others Watch the video! (7:07min) . . For example. A report is an effective way to present your data using an attractive layout. With these tools. as it automatically includes every field in the source table in the report. In our example. however. and all of the formatting options are still available to you in Layout View once the report is created.identify several report formatting and layout options that can be set in Layout View. in our bookstore scenario we have a table that lists all of the books in our inventory. though. you can either open the table. you will see how to use Print Preview and how to save the report. The Report Wizard walks you through the steps of creating a report. we used the open Books table to create the report. To do that. Download the example to work along with the video. Creating a Report Based on a Table One of the easiest ways to create a report is using a table as the source of the report. We want to create a Book Price List report that lists all of the details for each book in our store's inventory. The Report command.Tips for watching our videos. To Create a Report Based on a Table using the Report Command To create a report based on a table using the Report command: • Choose the table you wish to use as the source of your report. Finally. The text can be formatted in an Access report like it can be in Word documents. Microsoft Access 2007 offers tools that allow you to create and format a report. you can create a report based on a table or on a query. Sometimes. queries make the data in a database meaningful to you. The Report command makes this incredibly easy. is much easier to use.

The process for creating a report based on a query is identical to the process for creating a report based on a table that was outlined on the previous page. Book Price List The layout and formatting of the report can be manipulated in Layout View. And just like when making a report from a table. The report is automatically generated and includes every field in the table in order of their appearance in the table. To Limit the Number of Records in a Report . every field and record that appears in the query results will appear on the report. which was created form the table above. as seen above. Creating a Report Based on a Query Access 2007 can create a report using a query as the source. This can be seen in the example below.Report from Books Table • • Select the Report command on the Create tab in the Ribbon. as well.

Grouping Items on a Report Grouping items on a report can make it much more readable. using the query design screen. To Add Grouping to a Report To add a level of grouping to a report: • With the report open. Create the report using the Report command on the Create tab Format the report as desired.It is possible to limit the number of records in a report. select the Group & Sort command from the Grouping & Totals command group on the Format tab in the Ribbon. Return Limit • • • Click Run! to make sure the query results look like you want the report to look. To limit the records returned in a query: • • Open the query in Design View Use the Return option in the Query Setup command group to set the number of records you want to see in the query results and the final report. The limit is set in the query itself. Microsoft Access 2007 offers a quick and easy way to add grouping to a report. provided that the report was based on a query. .

and Total dialog box in the lower portion of the window. and Total dialog box. and Total Dialog Box • • In the Group. select Add a group. . Sort. Group.Grouping Command for Reports • This opens a Group. Sort. Sort. We chose to group our list by Category. Select the field you wish to group by from the drop down list.

as seen below. Sort.Grouping Drop Down List • When you release the mouse button. In Layout View. the report will now appear with items grouped. you can change the look of your report in many different ways. Books Price List Grouped on Category The Group. and Total dialog box will remain open until you close it. including: . Formatting a Report in Layout View Access opens the created report in Layout View. so that you can easily make modifications. Our report is grouped on Category now.

Logo Command for Report • When the Insert Picture dialog box opens. To Add a Logo to the Report To add a custom picture or company logo to a report: • Click on the Logo command on the Format tab in the Ribbon. Drag and drop the element to a new location on the report. Hit the Delete button on your keyboard. To Re-size a Column or Other Report Element To re-size a column or other report element: • • Highlight the element by clicking on it. find the picture file. . Drag and drop the edge of the element to the new size on the report. To Move a Column or Other Report Element To move a column or other report element: • • Highlight the element by clicking on it.• • • • • • deleting columns and other report elements moving and resizing columns adding a logo changing the title and other text on the report headings applying a report style with AutoFormat modifying the page layout To Delete a Column or Other Report Element To delete a column or other report element: • • Highlight the element by clicking on it.

type in the new title. font color. Title Command for Report • When the highlight appears. font face. and much more.Insert Picture Dialog Box • Click OK. . They all work basically the same way: • • Highlight the text you want to change Select the formatting option you wish from the lists that appear when you click on a command. You can modify the size. To Modify the Title of the Report To modify the title of a report: • Click on the Title command on the Format tab in the Ribbon. alignment. you can modify them using common Microsoft Office text formatting commands. To Modify Text in Report Headings If you don't like the standard font face and size that Access used to create your report.

To Change the Page Layout When a report is created. it opens in Layout View.Text Commands for Report • The change appears when you release the mouse button. The dotted lines are showing where the edge of the page will be in Report View. AutoFormats for Report • Select a format from the drop down list. The change is applied instantly. To apply a style: • Click on the AutoFormat command in the Ribbon. Microsoft Access 2007 offers a variety of report styles in the AutoFormat command. To Apply an AutoFormat Style Like with forms. like the one in the picture below. .

Page Layout Options for Report . Print Preview Command • Select the layout option you wish to alter from the Page Layout command group on the Ribbon.Report in Layout View To change the page layout options: • Switch to Print Preview using the Views command in the Ribbon.

Choose Save from the list that appears. However. If you do not ever need this report again. Challenge! If you haven't already done so. give the report a name. Microsoft Access 2007 will prompt you to name and save the report.All of the standard Microsoft page layout options are available. Save as Dialog Box • Click OK. save the sample Ready2Read database on your own computer. or normal To select either a Portrait or Landscape Orientation orientation Size To set the paper size Saving a Report When you have created and modified a report and try to close it. sorts. To Save a Report As with all Access objects. Modify the layout of a report by: o Resizing or moving columns o Deleting report elements o Giving the report a new title o Applying an AutoFormat style to the report o Use groups. Create a report based on query. including: Page Layout Option Description Margins To set the margins for narrow. it is best to save. • • • Create a report based on a table. if you think you may want to publish it again. or totals in a report . you need not save it. When the Save as dialog box opens. to save a report: • • • Right click on the report tab. wide.

Sign up to vote on this title
UsefulNot useful