Sunteți pe pagina 1din 30

Microsoft Access 2007 TutorialFree & Online

By Denise Etheridge You can use this free online tutorial to learn Microsoft Access 2007.Click here to start the tutorial.

Lesson 1: Getting Familiar with Microsoft Access 2007 for Windows

Microsoft Access is a database software package. A database is an organized collection of records. Telephone and address books are examples of paper databases. With Access, you can create a computerized database. For example, you can use Access to organize the students who attend a school, the courses they take, and the instructors who teach them. After you create an Access database, you can search it, manipulate it, and extract information from it. This lesson introduces you to Access windows and teaches you how to create a database.

Getting Started Understanding Security The Navigation Pane The Microsoft Office Button The Quick Access Toolbar The Title Bar The Ribbon Access Objects Change Views Close a Database and Exit Access Create a Database Create a Blank Database

Lesson 2: Creating Microsoft Access Tables


Tables are the foundation of an Access database. Access stores data in tables. This lesson teaches you how to create a table, add fields to a table, assign data types to fields, and set field properties. Understanding Tables

Name and Save a Table Understanding Data Types Explicitly Assign Data Types and Formats Understanding Design View Create a Lookup Column

Lesson 3: Working with Microsoft Access Tables


After you create an Access table, you can modify it, enter data into it manually or import data from somewhere else, such as Excel. This lesson teaches you how to modify a table and enter data. Enter Records

Import a Table into Access from Excel


Modify a Table Move around a Table Select Columns and Rows Delete a Record Resize a Column or Row

Lesson 4: Sorting, Filtering, and Creating Relationships


You can sort Access data so you can view records in the order you want to view them, and you can filter data so you only see the records you want to see. This lesson teaches you how to sort and filter an Access table. Access data is stored in multiple tables. Relationships join tables together so you can work with the data from multiple tables. This lesson also teaches you how to create relationships. Sort a Table

Filter a Table Apply a Specialized Filter Hide Columns Freeze Columns Format a Table Compute Totals Find and Replace Create Relationships

Lesson 5: Creating Microsoft Access Queries


You can use a query to view a subset of your data or to answer questions about your data. For example, if you want to view a list of student names and email addresses, but you do not want to see addresses and other data, you can create a query that displays the students first name, last name, and email address only. Alternatively, if you want to know which students live in DE, you can restrict your list to those students. This lesson teaches you how to create a query. Open Tables or Queries in Query Design View

Display All Records and All Fields Change from Datasheet View to Query Design View Retrieve a Single Column Retrieve Multiple Columns Sort a Query Sort Multiple Columns in a Query Retrieve Specific Records Apply Multiple Criteria Create a Query That Uses Two or More Tables Save a Query Modify a Query Use a Query to Make a Table Create a Parameter Query

Lesson 6: Creating Forms


Access forms are much like paper forms: you can use them to enter, edit, or display data. They are based on tables. When using a form, you can choose the format, the arrangement, and which fields you want to display. This lesson teaches you how to create forms. Using the Form Button

Create a Split Form Create a Multiple Items Form Modify a Form

Lesson 7: Creating Reports


Reports organize and summarize data for viewing online or for printing. A detail report displays all of the selected records. You can include summary data such as totals, counts, and percentages in a detail report. A summary report does not list the selected records but instead summarizes the data and presents totals, counts, percentages, or other summary data only. Access has several report generation tools that you can use to create both detail and summary reports quickly. This lesson teaches you how to create reports. Use the Report Button

Use the Report Wizard Modify a Report Create Mailing Labels Print a Report

Lesson 1: Getting Familiar with Microsoft Access 2007 for Windows


Microsoft Access is a database software package. Adatabase is an organized collection of records. Telephone and address books are examples of paper databases. With Access, you can create a computerized database. For example, you can use Access to organize the students who attend a school, the courses they take, and the instructors who teach them. After you create an Access database, you can search it, manipulate it, and extract information from it. This lesson introduces you to Access windows and teaches you how to create a database.

Getting Started
You use windows to interact with Access. To begin, start Access 2007. You screen will look similar to the one shown here.

Open the Northwind database in your computer The Navigation Pane


The Access window used in this example has been set up to make it easier to explain. This section shows you how to set up your window so that it matches the example. If you are not already logged in to Northwind, click the Login button. An Access database consists of the following objects: tables, queries, forms, reports, macros, and modules. The Navigation pane displays the objects in a database.

To manipulate the Navigation pane:

Click the double right-arrows

to open it. The arrows change to double left-arrows

Click the double left-arrows to close it. The arrows change to double right-arrows . In this example, the objects are organized by type, which is not the default setting. You may want to organize the objects in your database by type also. You can use the down-arrow on the top of the Navigation pane to change the manner in which objects are organized.

To organize objects by type: 1. Click the All Access Objects button on the Navigation pane. A menu appears. 2. Click Object Type. Access displays the objects in the database by type.
The Access window with the Northwind database open is shown here.

Note: Your window probably does not look exactly like the one shown. In Access 2007, the window display depends on the size of the window, the size of your monitor, and the resolution to which your monitor is set. Resolution determines how much information your computer monitor can display. If you use a low resolution, you can fit less information on your screen, but the size of your text and images are larger. If you use a high resolution, you can fit more information on your screen, but the size of the text and images are smaller. Also, you can use settings in Access 2007, Windows Vista, and Windows XP to change the color and style of your windows.

The Microsoft Office Button

In the upper-left corner of the Access window is the Microsoft Office button. When you click the button, a menu appears. You can use the menu to create a new file, open an existing file, save a file, and perform many other tasks.

The Quick Access Toolbar

Next to the Microsoft Office button is the Quick Access toolbar. The Quick Access toolbar provides you with access to commands you frequently use. By default, Save, Undo, and Redo appear on the Quick Access toolbar. You use Save to save an object, Undo to roll back an action you have taken, and Redo to reapply an action you have rolled back.

The Title Bar

The Title bar is located at the top in the center of the Access window. The Title bar displays the name of the database on which you are currently working.

The Ribbon

You use commands to tell Access what to do. In Access 2007, you use the Ribbon to issue commands. The Ribbon is located near the top of the Access window, below the Quick Access toolbar. At the top of the Ribbon are several tabs; clicking a tab displays related command groups. Within each group are related command buttons. You click buttons to issue commands or to access menus and dialog boxes. You may also find a dialog box launcher right corner of a group. When you click the dialog box launcher available. in the bottom-

, a dialog box makes additional commands

Access Objects To view or hide the objects on the Navigation pane:

You click the double down-arrows arrows .

to view objects. The double down-arrows change to double up-

You click the double up-arrows

to hide objects. The double up-arrows change to double down-arrows

As stated earlier, the Navigation pane stores the objects in your database: tables, queries, forms, reports, macros,

and modules. Objects always display with an icon to the right. The icon tells you the object type: query, form, report, macro, and module.

table,

Objects Tables In Access, data is stored in tables. A table is a set of columns and rows, with each column referred to as a field. Each value in a field represents a single type of data. Each row of a table is referred to as a record. You use queries to retrieve specific data from your database and to answer questions about your data. For example, you can use a query to find the names of the employees in your database who live in a particular state. Forms give you the ability to choose the format and arrangement of fields. You can use a form to enter, edit, and display data. Reports organize or summarize your data so you can print it or view it onscreen. You often use reports when you want to analyze your data or present your data to others. Macros give you the ability to automate tasks. You can use a macro to add functionality to a form, report, or control. Like macros, modules give you the ability to automate tasks and add functionality to a form, report, or control. Macros are created by choosing from a list of macro actions, whereas modules are written in Visual Basic for Applications.

Queries

Forms Reports

Macros Modules

You double-click an object to open the object. You right-click an object to view a menu of options. You can use the menu to do such things as open objects, rename objects, and delete objects. Objects that are open appear on tabs. Right-click a tab to view a menu of options you can perform, such as save the object, close the object, or change the view.

Change Views

A view is a way of looking at an object. For example, in Access, data is stored in tables. Two of the possible ways you can view a table are Datasheet view and Design view. You can see the data contained in a table in Datasheet view. You can see the design of a table in Design view. When you open an object, buttons appear in the lower-right corner of the Access window. You can use the View button on the Home tab to change views, or you can click the proper button in the lower-right corner of the window.

Close a Database and Exit Access


This completes the introduction to Access using the Northwind database. The following describes how you close a database and exit Access.

To close a database: 1. Click the Microsoft Office button. A menu appears. 2. Click Close Database. Access closes the database. To exit Access: 1. Click the Microsoft Office button. A menu appears. 2. Click Exit Access. You exit Access.

Create a Database
When you start Access, the Getting Started With Microsoft Office Access screen appears. You can use this screen to create a database. Within a database, you can do such things as enter data, create reports, and retrieve data. You can create a blank database or you can use one of the templates provided by Microsoft. When you use a template, Access creates forms you can use to enter data, reports you can use to retrieve data, and more. You can modify the forms, reports, and other objects to suit your needs. This tutorial will teach you how. The following templates are included with Access: Assets, Contacts, Events, Faculty, Issues, Marketing Projects, Projects, Sales Pipeline, Students, and Tasks. Other templates are available online. Each template creates a database related to the title. For example, the Faculty template creates a faculty database that includes tables, queries, forms, and reports related to faculty. In Access, you use tables to store data, queries to retrieve data, forms to enter data, and reports to display data.

To use a template to create a database:

1. 2. 3. 4. 5. 6. 7.

Start Access. The Getting Started With Microsoft Office Access screen appears. Click Local Templates. Icons representing local templates appear in the center of the window. Click the icon for the template you want to use. Click the Browse button. The File New Database window appears. Locate the folder in which you want to store your database. Click OK. Click Create. Access creates and opens your database.

8. Open the Navigation pane. Access displays the tables, queries, forms, reports and other objects related to
the database you selected. You may wish to display the objects by type.

How do I open an existing database?

1. 2. 3. 4. 5.

Click the Office button. A menu appears. Click Open. Locate the folder in which you stored your database. Click the database name. Click Open. Access opens the database.

Tip: You can also open an existing database by pressing Ctrl-O and then following steps 3 through 5.

Create a Blank Database


A blank database is a database with nothing in it. You must create all the tables, forms, reports, queries, and so on. If you cannot find a template that suits your needs, create a blank database. After you create the database, Access opens to a datasheet and makes available the tools you need to create objects. Creating tables is the first step in building a database. You will learn more about creating tables in the next lesson.

To create a blank database:

1. Start Access. 2. Click Blank Database. 3. Type the name you want to give your database in the File Name field. Access will automatically append
.accdb to the name.

4. Click the Browse button. The File New Database window appears. 5. Locate the folder in which you want to store your database. Note that the name of the file appears in the File
Name field.

6. Click OK. 7. Click the Create button. Access creates the database and opens a datasheet with the Table Tools available
to you. Note the Table Tools in the upper-right portion of the Ribbon.

What is a Datasheet? In Access, data is stored in tables. A datasheet displays the information stored in a table in columns and rows. The columns are called fields and the rows are called records. You can use a datasheet to create a table, enter data, retrieve data, and perform other tasks.

Lesson 2: Creating Microsoft Access Tables


Tables are the foundation of an Access database. Access stores data in tables. This lesson teaches you how to create a table, add fields to a table, assign data types to fields, and set field properties.

Understanding Tables
A table is a set of columns and rows. Each column is called a field. Within a table, each field must be given a name and no two fields can have the same name. Each value in a field represents a single category of data. For example, a table might have three fields: Last Name, First Name, and Phone Number. The table consists of three columns: one for last name, one for first name, and one for phone number. In every row of the table, the Last Name field contains the last name, the First Name field contains the first name, and the Phone Number field contains the phone number. Each row in a table is called a record.

All of the data in a table should refer to the same subject. For example, all of the data in the Employees table should refer to employees, all of the data in the Students table should refer to students, and all of the data in the Courses table should refer to courses. You can view an Access database as a collection of related tables. For example, in a database that contains tables for Employees, Students, and Courses, the Employees table lists the employees, the Students table lists students, and the Courses table lists the courses students can take. After Access creates a blank database, it opens in Datasheet view and makes available the tools you need to create a table. Datasheet view displays a table as a set of columns and rows. When you view a blank database for the first time in Datasheet view, you see a column named ID. This column is by default the primary key field. A primary key is a field or combination of fields that uniquely identify each record in a table. No two records in a table should have the same values in every field. For example, the following should not occur in a table.

Last Name Smith Smith

First Name John John

City Jonestown Jonestown

In the real world, it is possible to have two people from the same city with the same first and last name. In cases like this, you can use the ID field as the primary key field and use it to make each record unique. The ID field has a data type of AutoNumber; as a result, Access automatically creates a unique number for each record in the database. The resulting table will look like the one shown here.

ID 1 2

Last Name Smith Smith

First Name John John

City Jonestown Jonestown

Access provides several methods for creating a table. One method is to use the Rename option with the Add New Field column label to give each column the field name you want it to have and then to type or paste your data into the table. Field names can include letters, numbers, and spaces and can be up to 64 characters long. When choosing a field name, try to keep it short. When you save your table for the first time, Access gives you the opportunity to name your table. Each table name must be unique; hence, two tables in the same database cannot have the same name. The table name should describe the data in the table; can consist of letters, numbers, and spaces; and can be up to 64 characters long. When choosing a table name, try to keep it short. You can save a table by clicking the Save button on the Quick Access toolbar or by right-clicking the Tables tab and then choosing Save from the menu that appears.

To add fields to a table:

1. 2. 3. 4. 5.

Click the Add New Field column label. Activate the Datasheet tab. Click Rename in the Fields & Columns group. Type the field name. Press Enter. Access creates the field.

6. Type the next field name. Access creates the field. Continue until you have created all of the fields in your
table.

7. Press Enter without entering a field name to end your entries.


Or

1. 2. 3. 4. 5.

Right-click the Add New Field column label. A menu appears. Click Rename Column. Type the field name. Press Enter. Access creates the field. Type the next field name. Access creates the field. Continue until you have created all of the fields in your table.

Name and Save a Table


After you create a table, you must name and save it.

To name and save a table:

1. Click the Save button on the Quick Access toolbar. The Save As dialog box appears. 2. Type the name you want to give your table. 3. Click OK. Access names your table.

Tip: You can use the Rename option at any time to rename any column. For example, you can rename the ID column Employee ID.

Understanding Data Types


In Access, you use data types to specify the type of data each field can capture. A field with a data type of text can store alphabetic characters and numbers. Generally speaking, you cannot perform mathematical calculations by using a text field. For example, you can use a text field to store a street address. Unless you do some manipulation, you cannot use the numbers in the street address in mathematical calculations. You will not be able to sum or average the numbers in an address field, which is fine, because you probably do not want to. Alternatively, you can assign a Test Score field a data type of Number. You can enter numbers into the field and then average, sum, or perform other calculations with the numbers. However, you cannot enter an alphabetic character in a number field.

Data Types Data Type Text Use Notes

Alphanumeric data. Use for text . and for numbers that are not used in mathematical calculations. Use for names, addresses, and other relatively short pieces of text. Can store up to 255 characters. Long text. Use for long pieces of text, such as notes and long descriptions. Can store up to 64,000 characters. Numeric data. Use for numbers If you are working you want to use in mathematical with currency, use calculations. the currency type. Use for dates and times. Use for currency. Prevents rounding during calculation.

Memo

Number

Date/Time Currency

AutoNumber

Unique sequential numbers or random numbers automatically inserted when you create a record. Use to create a primary key. Logical data. Use when only one of two values is valid. Yes/No, True/False, etc. Use to store hyperlinks. Use to store attachments. Use to attach an OLE object such as a Word document, Excel

Yes/No

Hyperlink Attachment OLE Object

spreadsheet, or PowerPoint presentation.


After you create the fields for a table, you can enter data by typing in each field. As you type, Access assigns a data type to each field based on your entry.

Assigned Data Types Sample Entry Smith http://www.website.com 10000 10,000 10,000.99 10000.999 01/01/2009 The date and time formats recognized are those of your user locale. January 1, 2009 12:10:33 12:30 am 16:50 100.50 25.00% 1.23E+02 Data Type Assigned Text Hyperlink Number, Long Integer Number, Long Integer Number, Double Number, Double Date/Time

Date/Time Date/Time Date/Time Date/Time Number, Double Number, Double Number, Double

Explicitly Assign Data Types and Formats


You may want to change the data type Access assigned to a field, or you may want to explicitly assign a data type to each field. You can do so by choosing the Datasheet tab and then selecting the proper option in the Data Type field in the Data Type & Formatting group. Some data types allow you to select the formatting you want. By formatting, you determine how data in a field displays. For example, if you choose a data type of number and a format of Euro, any number you enter will appear with a Euro sign in front. Windows regional settings enable you to display information such as dates, times, and currency that match the standards or language used in the country in which you live. For example, if you live in the United States, the currency setting uses a dollar sign.

Regional Settings for English (United States) Number Currency Time Short Date Long Date 123,456,789.00 $123,456,789.00 3:39:44 PM 7/28/2008 Monday, July 28, 2008

Use the Windows Control panels Regional and Language options to view or change regional settings.

Data Types Data Type Number Format How Numbers Display

General Number As typed. Currency Uses thousands separator. Follows regional settings. Uses currency format with Euro symbol. Displays at least one digit. Follows regional settings. Uses thousands separator. Follows regional setting. Converts entry to percent.

Euro Fixed

Standard

Percent

Scientific Currency

Uses scientific notation.

General Number As typed. Currency Uses thousands separator. Follows regional settings. Uses currency format with Euro symbol. Displays at least one digit. Follows regional settings. Uses thousands separator. Follows regional setting. Converts entry to percent. Uses scientific notation. Date values display as numbers and time values as hours, minutes, and seconds followed by AM or PM. Follows regional settings. Uses the Long Date format specified in your Windows regional settings. Uses dd/mmm/yy, using the date separator specified in your Windows regional settings. Uses the Short Date format specified in your Windows regional settings. Uses hours, minutes, and seconds followed by AM or PM. Uses the separator specified in the Time setting in your Windows regional settings. Displays hours and minutes followed by AM or PM. Uses the separator specified in

Euro Fixed

Standard

Percent Scientific Date/Time General Date

Long Date

Medium Date

Short Date

Long Time

Medium Time

the Time setting in your Windows regional settings. Short Time Uses hours and minutes. Uses the separator specified in the Time setting in your Windows regional settings. Yes/No True/False On/Off

Yes/No

To explicitly assign a data type or format to a field:

1. 2. 3. 4.

Click the field label for the field to which you want to assign a data type. Activate the Datasheet tab. Click the down-arrow next to the Data Type field and then choose a data type. Click the down-arrow next to the Format field and then choose a format. Access assigns a data type and format to the field you selected.

Tip: If you want every record in a field to be unique, check the Unique box on the Datasheet tab in the Data Type & Formatting group. If you do not want the user to leave a field blank, check the Is Required box.

Tip: In the Data Type & Formatting group, there are several formatting options you can apply to numbers. If

you want to use the Currency format, click the Currency button

; if you want to use the Percent format, click the

Percent button

; if you want to use a Comma number format, click the Comma button

; or if you want to

increase or decrease the number of decimal place, click the Increase Decimal .

or Decrease Decimal button

Tip: You can create a new table at any time by activating the Create tab and then clicking Table.

Understanding Design View


Access provides several ways to view the objects in your database. You can use Design view to create or modify an Access table. You can use the View button on the Home tab or the Table Design button on the Create tab to change to Design view. Using Design view is the preferred method for creating a table because it provides you with the most options and enables you to precisely define your table. In addition to selecting a data type, you can set all of the following options in Design view.

Design View Options Field Property Field Size Data Type Text Comments Enables you to restrict the number of characters stored in a text field to 0 to 255 characters. The default is 255. Enables you to select the type of number stored in a field. Values Stored 0 to 255. (No fractions) 9.999... x 1027 through +9.999... x 1027 32,768 to +32,767 (No fractions) 2,147,483,648 to +2,147,483,647 3.4 x 1038 to +3.4 x 1038 numeric floating point values. Up to seven significant digits. 1.797 x 10308 to +1.797 x 10308 1038 numeric floating point values. Up to

Number

Number Types Byte Decimal

Integer Long Integer Single

Double

fifteen significant digits. Replication ID Globally Unique Identifier (GUID). Used by Access to establish a unique identifier for replication. Determines how numbers display. When you use the currency, fixed, standard, and percent formats. Access follows the settings specified in Regional Settings in the Windows Control Panel for negative amounts, decimal and currency symbols, and decimal places. Displays as typed. Uses thousands separator. Follows regional setting. Uses currency format with Euro symbol. Displays one digit. Follows regional settings. Uses thousands separator. Follows regional settings. Converts entry to percent. Uses scientific notation. Displays date and time. Example: 01/02/99, 06:28:21 PM Displays Day of Week and Date: Example: Saturday, January 02, 1999 Example: 02-Jan-99 Example: 01/02/99

Format

Number

Currency Number

General Number Currency

Euro

Fixed

Standard

Percent Scientific Date/Time General Date

Long Date

Medium Date Short Date

Long Time Medium Time Short Time Text and Memo @ & < > Yes/No Yes/No

Example: 6:28:21 PM Example: 6:28 PM Example: 18:28 Text character required. Text character not required. Changes all characters to lowercase. Changes all characters to uppercase. If the Lookup Display Control is a text box, displays Yes/No. If the Lookup Display Control is a text box, displays True/False. If the Lookup Display Control is a text box, displays On/Off. Auto. Number of decimals displayed depends on the format setting.

True/False

On/Off

Decimal Places

Determines number of decimal places Access displays.

015. Used with format property. Determines the number of digits that display to the right of the decimal point. Input Mask Special characters used to control the values the user can input. Field name displayed on forms. Sets the value that appears in the field by default when a record is created.

Caption

Default Value

Validation Rule

Sets the requirements for user input. Text for error messages that are sent when validation rules are broken. Specifies whether the field is Yes: Required required or not. No: Not Required Determines whether a zerolength field is a valid entry. Specifies whether an index should be created in a field. Indexes speed up queries. Yes: Is valid No: Not valid Yes: Create index. No: Do not create index.

Validation Text

Required

Allow Zero Length

Index

To use Design view to create a new table:

1. Activate the Create tab. 2. Click Table Design in the Tables group. Access changes to Design view and the Table Tools become
available.

3. 4. 5. 6. 7.

Type the first field name in the Field Name field. Press the Tab key. Click the down-arrow that appears when you click in the Data Type field and then select a data type. Click Primary Key if the column you created is a primary key. A small key appears next to the field name. Press the Tab key.

8. Type a description. The description is optional. 9. Press the Tab key. Access moves to the Field Name field. 10. Repeat steps 3 through 10 until you have created all of your fields. To set field properties:

Repeat steps 1 through 3 until you have set all the properties for all fields. You can use Design view to create or modify a table. After you finish the task, you must save the table by clicking the Save button on the Quick Access toolbar.

1. 2. 3. 4.

Click the field for which you want to set the field properties. Activate the General tab in the Field Properties area. Set the properties you want to set.

1. Click the Save button on the Quick Access toolbar. Access saves the table unless you are saving for the first
time. If you are saving for the first time, the Save As dialog box appears.

2. Type the name you want to give your table. 3. Click OK. Access saves the table. You can now access the table by using the Navigation pane.

What are views? Views are different ways of looking at the same object. Tables have four views: Datasheet view, Pivot Table view, Pivot Chart view, and Design view. You use Datasheet view to create a table, edit data, or view data; Pivot Table view to create a pivot table; Pivot Chart view to create a pivot chart; and Design view to create a table or modify an existing table.

To change the view: 1. Activate the Home tab. 2. Click the down-arrow under the View button. A menu appears. 3. Click the view you want. Access changes to the view you chose.

Tip: You can also use a template to create a table. Access has several templates from which you can choose. When using a template, you create the table and then modify it to suit your needs.

1. Activate the Create tab. 2. Click the Table Templates button in the Tables group. A menu appears. 3. Click the template you want to use. Access creates a table based on the template. Create a Lookup Column
If a field can contain a finite list of values, you can create a Lookup Column and users can select the value they want from a list. For example, if the employees at a school can only work in one of the following departments: Administration, Computer Science, English, History, or Math. You can create a table Departments table that lists the departments and then use the list in the Employee table to assign each employee to a department.

Departments Department ID Primary Key 1 2 3 4 5 Administration Computer Science English History Math Department

Access has a wizard to help you create lookup columns. Creating a Lookup column creates a relationship between two tables. See the section Create Relationships in Lesson 3 to learn more about relationships.

To use the Lookup Wizard to create a lookup column: Open the Lookup Wizard

1. 2. 3. 4. 5.

Open the table to which you want to add a lookup column. Click the field label for the field before which you want to add a lookup column. Activate the Datasheet tab. (You must be in Datasheet view.) Click the Lookup Column button in the Fields & Columns group. The Lookup Wizard appears. Make sure the radio button next to I want the lookup column to look up the values in a table or query. is selected.

6. Click Next. The Lookup Wizard moves to the next page. Select your table or query
A lookup column can be based on a table, a query, or a list of values you type. If you base your lookup column on a table or query, you must create the table or query before creating the lookup column. A query is a list of rows and columns based on one or more tables. A query only displays the rows and columns you specify.

1. Click a radio button to select what you want to base your lookup column on. Choose from Tables, Queries,
or Both.

2. Click to select the table or query you want. 3. Click Next. The Lookup Wizard moves to the next page. Select fields
You choose the fields you want to appear in your lookup column. Be sure to include the primary key.

1. Click the field you want. 2. Click the single right-arrow button . Access places the field in the Selected Fields column. Repeat this
process to select additional fields. If you want all the fields in the table, click the double right-arrow button . Note: Use the single left-arrow and the double left-arrows to deselect fields.

3. Click Next. The Lookup Wizard moves to the next page. Sort fields
The Lookup Wizard allows you to sort the records in a lookup column. You can display records in order, either ascending (alphabetical from A to Z, lowest number to highest number, earliest date to latest date) or descending

(alphabetical from Z to A, highest number to lowest number, latest date to earliest date). You can also sort within a sort. For example, you can sort by state and then within each state by city, and then within each city by street address. If you are creating a sort within a sort, create the highest level sort on line one, the next level sort on line two, and so on. In the state, city, and street address example, you create the state on line one, the city on line two, and the street address on line three.

1. Click the down-arrow and then select the field you want to sort by. 2. Click to select a sort direction (the button toggles between ascending and descending). You can sort within a
sort for up to four levels.

3. Click Next. The Lookup Wizard moves to the next page. Adjust column widths
A key column is the column that connects one table or query to another table or query. For example, you can use the Department ID field in the Employees table and the Department ID field in the Departments table to connect the two tables. You may, however, want to display the name of the department when you view the table but not the department ID; if so, leave the Hide Key Column box checked.

1. Deselect Hide Key Column, if you wish. 2. Adjust the column widths by dragging or double-clicking the right vertical border for the column. 3. Click Next. The Lookup Wizard moves to the next page. Specify the Key Field (if you deselected Hide Key Column)
A key field is a field that uniquely identifies a record. If you deselected Hide Key column, you must tell Access which field is the key field.

1. Click the key field. 2. Click Next. The Lookup Wizard moves to the next page. Name the column
Field names appear at the top of each column. On this page of the Wizard you tell Access what you want to name your lookup column. In Access 2007, multiple values can appear in a field; click the Allow Multiple Values checkbox if you want to allow multiple values.

1. Type the name you want to give the column.

2. Click if you want to allow multiple values in the field. 3. Click Finish. Access creates the lookup column.

How do I create a lookup column by typing a list?

1. 2. 3. 4. 5. 6. 7. 8. 9.

Activate the Datasheet tab. (These instructions assume you are in the Datasheet view.) Click the Lookup Column button in the Fields & Columns group. The Lookup Wizard appears. Click the radio button next to I will type the values I want. Click Next. The Lookup Wizard moves to the next page. Type the number of Columns you want in the Number Of Columns field. Type the values you want under the column heading. Click Next. The Lookup Wizard moves to the next page. Type the column label you want. Click Finish. Access creates a lookup column based on your list.

S-ar putea să vă placă și