Create tables
I. What is Table?
A table is constructed with a field or many fields and it is used for storing data or information. The data can be students’ information, teachers’ information, employees’ information, list of products, product categories etc.II. How to Create a Table
In Microsoft Access 2010, we introduce you how to create a table in Desktop Database and Web Database.
II.1. How to Create a Table in Desktop Database
In this section, we illustrate two ways of creating a table including create a table with Datasheet View and Create a table with Table Design.
II.1.1.Create a table with Datasheet View
Creating a table in this way allows you to enter directly the field names and choose the data types for the fields in datasheet view. In addition, you can open the table in Design View also. To create a table:
- Open a Desktop Database file that you created
- Click Create tab
- Click Table in Tables group
A new blank table open in datasheet view as the figure below:
- Click Click to Add to choose a data type for the filed
- Enter the field name for this field
- Press Enter Key or Click Click to Add to create a next new field
- Press Enter Key or Click Click to Add to create a next new field
Note: Normally, when you create a table with datasheet view, the table open in datasheet view with a created ID field(AutoNumber data type). If you want to change the name of the field, double-click on the field and then enter a new name for that field.
II.1.2. Create a table with Table Design
It is the most popular way to create a table because it allows you to create the table with many properties to set on the field such as Field Size, Format, Input Mask, Validation Rule, Validation Text, Indexed and so on. To create the table:
- Open a Desktop Database file that you created
- Click Create tab
- Click Table Design, in Tables group
A new blank table open in design view as the figure below:
As you see on the figure, there are three header columns: Field Name, Data Type and Description.
- Field Name: Where you have to enter the field name of the table.
- Data Type: Data type determines the type of your data stored in each field of the table.
- Description: It is not required--you write description or not up to you.
After you select the enter the field name, you have to select the data type for the field. The data type is extremely useful for the field because it determines data that can enter in the field. The following table demonstrates all the data types of field.
| Data Type |
Description
|
Size
|
| Text | Text or mix of text, as well as number doesn’t use for calculation, such as telephone number, id number. | 0 Up to 255 characters |
| Memo | The same of text data type but it is longer. | 64Kb or 64000 characters |
| Number | Numeric data use in mathematic calculation | 1, 2, 4, 8 bytes |
| Date/Time | Date and time values | 8 bytes |
| Currency | Currency values or Numeric data used in mathematic calculation | 8 bytes |
| AutoNumber | Number add to row automatically and uniquely | 4 bytes |
| Yes/No | Boolean value(True/False) | 4 bytes |
| OLE Object | Object such as graphic, Word, Excel ,etc. | 1 gigabyte |
| Hyperlink | Text or number stored as text and use as Hyperlink Address or URL such as Website. | 2048 characters |
| Attachment | Use for many types of data and attach them like email’s attachment file. | |
| Lookup Wizard | Create default value for selecting when enter data into table. |
Note: You can create lookup wizard on a field of table if your table field has a data type as Text, Yes/No or Number.
In Access 2010, you will see a new data type call Calculated data type. This data type allows you to enter an expression for calculating the fields. For example, calculate Total by multiplying Quantity and UnitPrice fileds of TblProduct. To do so, follow the steps below:
- On the Total field select Calculated data type as the figure below:
- The Expression Builder dialog appears
- Enter an expression like in the Expression Builder dialog
II.2. How to Create a Table in Web Database
There is only one way to create a table in Web Database. To create the table do the following steps:
- Open a Web Database file that you created
- Click Create tab
- Click Table in Table group
A new blank table open in datasheet view like you create a table with Datasheet View in Desktop Database
- Enter the field names and choose a data type for a field
No comments:
Post a Comment