Create Table (Table) in Access 2016

The objects in the database depend a lot on the table, you should always start designing your database by creating all the tables.

When creating a database, you will store your data in Table objects. Objects in the database depend a lot on the table, you should always start designing the database by creating all tables, then new objects. Before creating a table, carefully review your requirements and identify all the tables you need.

Create the Datasheet View table

Let's try to create the first table, storing basic information of Company employees as follows:

School's name
Datatypes
NhanvienID AutoNumber Ten Short Text Ho Short Text Diachi1 Short Text Diachi2 Short Text Short Text Thanhpho Short Text Mabuudien Short Text Dienthoai Short Text

According to the table above, we have the Short Text data type that applies to all data fields. Next, open an empty database in Access.

Create Table (Table) in Access 2016 Picture 1Create Table (Table) in Access 2016 Picture 1

This is the area we will work with. When opening an empty database, Access automatically in the Datasheet View table mode .

Now that we switch to the Field tab, you'll see that the ID field is automatically set to the AutoNumber data type, which is the unique ID and the primary key in this table.

Create Table (Table) in Access 2016 Picture 2Create Table (Table) in Access 2016 Picture 2

The ID field is already created, now we rename it to suit our requirements. Click Name & Caption in the Ribbon and you will see a dialog box appear.

Create Table (Table) in Access 2016 Picture 3Create Table (Table) in Access 2016 Picture 3

Create Table (Table) in Access 2016 Picture 4Create Table (Table) in Access 2016 Picture 4

Change the name of this field to NhanvienID to match the created table. Enter other optional information if you want and click OK .

Create Table (Table) in Access 2016 Picture 5Create Table (Table) in Access 2016 Picture 5

Now let's add some fields by clicking Click to add .

Create Table (Table) in Access 2016 Picture 6Create Table (Table) in Access 2016 Picture 6

Select the Short Text data type and enter a name in all fields.

Create Table (Table) in Access 2016 Picture 7Create Table (Table) in Access 2016 Picture 7

When all fields are fully added, click the Save icon to bring up the Save As dialog box, enter the table name into the Table Name for the newly created table.

Create Table (Table) in Access 2016 Picture 8Create Table (Table) in Access 2016 Picture 8

You may wonder, the prefix tbl stands for table . Click OK and you will see the table appear in the navigation pane.

Create Table (Table) in Access 2016 Picture 9Create Table (Table) in Access 2016 Picture 9

Create the Design View table

In the example above Quantrimang created the Datasheet View table. Now we will create another table using Table Design View on a project, including the following fields:

School's name
Datatypes
DuAnID AutoNumber TenDuAn Short Text BienTap Short Text TacGia Short Text TinhTrang Short Text HopDong Attachment TimeBatdau Date / Time Time Date / Time NganChang Currency Write Long Text

Next go to the Create tab .

Create Table (Table) in Access 2016 Picture 10Create Table (Table) in Access 2016 Picture 10

Click Table View , you can see this interface field name and data type will be placed side by side, completely different from Datasheet View.

Create Table (Table) in Access 2016 Picture 11Create Table (Table) in Access 2016 Picture 11

Now we need to set DuAnID as the primary key for this table, select DuAnID and click the Primary Key option in the ribbon.

Create Table (Table) in Access 2016 Picture 12Create Table (Table) in Access 2016 Picture 12

You can now see a small key icon that will display next to that field.

Next, save and name this table.

Create Table (Table) in Access 2016 Picture 13Create Table (Table) in Access 2016 Picture 13

Click OK. You can also edit this panel to the Datasheet View format by clicking the View button in the left corner of the Ribbon

Create Table (Table) in Access 2016 Picture 14Create Table (Table) in Access 2016 Picture 14

If you want to edit this or any specific field, you can edit it directly in this form, without having to go back to Design View to change it. For example, update the TinhTrang field as shown below.

Create Table (Table) in Access 2016 Picture 15Create Table (Table) in Access 2016 Picture 15

Click Ok to see the changes.

Create Table (Table) in Access 2016 Picture 16Create Table (Table) in Access 2016 Picture 16

Previous article: Data types in Access 2016

Next lesson: Working with Table in Access 2016

4 ★ | 2 Vote