• توجه: در صورتی که از کاربران قدیمی ایران انجمن هستید و امکان ورود به سایت را ندارید، میتوانید با آیدی altin_admin@ در تلگرام تماس حاصل نمایید.

آموزش کامل Access 2007-EN

A M I R

کاربر ويژه
[h=2]Setting up Tables and Fields


[h=3]Naming a Table

To give the table a unique name, you must first click on the Microsoft Office Button in the upper left hand corner of the application.


ac07_rename_table1.gif




Then, select Save from the menu. The Save As dialog box will appear to let you save the table as whatever name you choose.


ac07_rename_table1_2.gif




The new table names appear in both the Navigation Pane and the Table tab itself, as you can see in the picture below.

ac07_renamed_table.gif



TIP: Give your tables logical, easy to understand names.











 

A M I R

کاربر ويژه
[h=2]Setting up Tables and Fields


[h=5]To Rename a Table

With the table closed, right click on the Table you wish to rename in the Navigation Pane. Select

the Rename option that appears in the menu.




ac07_table_rename.gif



The table name will be highlighted and a cursor will appear, which means you can now type in the new

name
right there. Left click anywhere outside of the Table name to make the change.



 

A M I R

کاربر ويژه
[h=2]Setting up Tables and Fields


[h=5]To Close a Table

To open a table, right click the Table name of the table you wish to open in the Navigation Pane. Then, choose Open from the menu.


ac07_table_open.gif




A more common method is to double click the table name in the Navigation Pane. The

selected table will open in the active database object window.





 

A M I R

کاربر ويژه
[h=2]Setting up Tables and Fields



[h=3]Adding More Tables to the Database

By default, Access 2007 starts out with one table. To add more tables to the database, click on the Create tab on the Ribbon.


ac07_create_table.gif




Then, select Table from the Tables command group. A new table will open in the active database object

window. You must name your table using the Save command from Microsoft Office menu. 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.




 

A M I R

کاربر ويژه
[h=2]Setting up Tables and Fields


[h=3]Adding Fields to a Table

Access 2007 allows you to add fields to tables when you are:



  • working in Datasheet View, which looks like a spreadsheet


  • working in Design View, where you are able to set more controls for your fields.

Either way, you need to know how to switch between the two views.








 

A M I R

کاربر ويژه
[h=2]Setting up Tables and Fields


[h=5]Switching Views
To switch views, select the Views command group from either the Home tab (seen below) or

the Datasheet tab on the Ribbon. Select the view option you would like from the menu.


ac07_views.gif

 

A M I R

کاربر ويژه
[h=2]Setting up Tables and Fields


[h=5]Adding Fields in Datasheet View

By default, Access 2007 creates one field in each new table, the ID field. This field auto-numbers

to give each record in the table a unique number identifier. Recall that records are the rows in a table.



TIP: You may want to rename the ID field with a unique name, since the ID field appears automatically in

every table you create. While this is not necessary, it may help avoid confusion when setting up table relationships.



ac07_id_field.gif



To add more fields to a table in Datasheet View, double click on the Add New Field header.

ac07_add_new_field.gif



The Add New Field text will disappear from the header. Name the field by typing the name directly

into the header. Press the tab key on your keyboard to move to the next field.







 

A M I R

کاربر ويژه
[h=2]Setting up Tables and Fields


[h=5]Adding Fields in Design View

In Design View, the field names are along the left-hand column instead of across the top like in Datasheet View, as seen below.


ac07_design_view_fields.gif




To add a new field to a table in Design View, just click in the cell where you want the new field and type

the field name
. When you switch back to Datasheet View, your new field appears as its own column, as seen below.


ac07_datasheet_view_field.gif




In Design View, you have many field property options that you can set to ensure that data can only be entered

in certain formats. Setting these options is a good idea if you want to make sure the data that you have in your database is good, strong data.









 

A M I R

کاربر ويژه
[h=2]Setting up Tables and Fields


[h=5]Moving Fields

If you want to rearrange the order in which your fields appear in a table, Access 2007 lets you easily

move them around. To move a field in Datasheet View, drag and drop the field to the location you want. To do this:




  • Click on the field header for the field you wish to move.



  • Move the mouse in the area of the header.



  • When the cross with arrows appears, hold down your left mouse button.



  • With the left mouse button still held down, move the cursor to where you would like the field to appear.


  • Release the mouse button and the field appears in its new location.


 

A M I R

کاربر ويژه
[h=2]Setting up Tables and Fields


[h=5]Deleting Fields

To delete a field in Datasheet View, just click on the field header and then select Delete from

the Field &Column command group. This is found on the Datasheet tab on the Ribbon.



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!



 

A M I R

کاربر ويژه
[h=2]Setting up Tables and Fields



[h=3]Setting the Data Type for a Field

Access 2007 lets you control how data can be entered in each table field within your database. This is

done using Data Type. The default Data Type is text for every field after the ID field, which was

set to auto number. 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


 

A M I R

کاربر ويژه
[h=2]Setting up Tables and Fields


[h=5]From the Ribbon
To change the data type from the Ribbon, click on the field header. Then, select the data type you want from the drop down menu next to the Date Type command.

ac07_datatype_ribbon.gif





 

A M I R

کاربر ويژه
[h=2]Setting up Tables and Fields



[h=5]In Design View

To change the data type in Design View, click the field name and then press the tab key on

your keyboard. From the drop down menu under the Data Type column, select the format you want.



ac07_datatype_designview.gif


The Data Type is more noticeable when the database is being populated with records. It will cause data to be

formatted for currency, text, number, and date/time just in Microsoft Excel.






 

A M I R

کاربر ويژه
[h=2]Setting up Tables and Fields


[h=3]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




 

A M I R

کاربر ويژه
[h=2]Building Table Relationships


[h=3]Introduction

By now, you have set up the tables you need for your database, and created fields for those different tables. Relationships

provide Access 2007 with the means to bring that information together for you when you need it.

This lesson explains how to establish relationships between the tables in an Access 2007 database. You will learn how

to read and manipulate the relationship map. You will also learn about Primary and Foreign Keys, relationship

types
, and about referential integrity.




ac07_lesson5_relationships.gif

 

A M I R

کاربر ويژه
[h=2]Building Table Relationships


[h=3]Building Table Relationships
[h=3]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.


NOTE: Tables must be closed in order to establish relationships.


ac07_relationships_command.gif




When the Show Table dialog box appears:




  • Select each table name and click Add for the tables you want to relate.
  • When you are done, Close the Show Table dialog box.
ac07_showtable.gif



You should now see a relationship map that contains all the tables that were selected.

ac07_relationship_map.gif










 

A M I R

کاربر ويژه
[h=2]Building Table Relationships


[h=3]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.



  • Hold down the left mouse button, and drag the table to a new location.



  • Release the mouse button to drop the table in its new place.




 

A M I R

کاربر ويژه
[h=2]Building Table Relationships



[h=3]Understanding the Relationship Map
The relationship map lists all of the tables that were selected to relate, and all of the fields that were set up

for that table previously. Notice that the first field has a key icon next to it. This is the Primary Key for the table.



ac07_primary_key.gif


 

A M I R

کاربر ويژه
[h=2]Building Table Relationships


[h=5]Primary and Foreign Keys
A Primary Key is the first field in each table of the database. You may recall that this field auto

numbers by default, so that every record in the table has its own unique number to identify it. Access

uses this number to quickly pull information together for you when you run queries or reports, which are covered later.



In the example above, the primary key for the Customers table is Customer ID, the primary key for

the Orders table is Order ID, and the primary key for the Books table is Book ID.



A Foreign Key is a field that is the Primary Field in its own table, but that shows up in another table. If you

look closely at the Orders table, the fields Customer ID and Book ID appear there, as well as in their

own respective tables. These fields are the primary key in their own tables, but in the Orders table, they are considered Foreign Keys.



ac07_foreignkey.gif


 

A M I R

کاربر ويژه
[h=2]Building Table Relationships


[h=3]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, but the Drag and Drop method is much easier and saves you several steps.





 
بالا