How to Create a Table in Design View in Access

Way to work with Tables in the Design View. 

How to Create a Table in Design View in Access

In the Design view, you can also create table and specify the field types and filed lengths as per your requirements. You can also set the primary Key, validations and other data entry controls in this view. 

Way to work with Tables in the Design View.

To create a table in the Design view

1.Click on the Create tab. 

2.Click on the Table, Table Constructed tab. 

3.The blank Table structure layout will you open in the Datasheet view.

4.Click on the Arrowhead of the view button and select the Design view option. 

5.The Save As dialog box opens. Give a name to the Table and click on the OK button. 

6. You will see one fields with the name fields name "ID" automatically inserted with the AutoNumber Type. 

7. You can click in the cell below the ID fields. Type the newer Field name (here, English ) and press the Enter Key

8. The cursor will shift to the Data type column. Select the data type for the field. Add the description (what does this field store, etc) if required.

How to set the setting of Field Properties? 

While entering the Data Type, you will see Field properties for that field. You can set those properties as shown below. 

Caption

It is a title given to a field name. You can use this properties to give a more relevant name to the field. 

Default view 

It is the value which will be automatically inserted into the field while entering a record. 

For example, The function Date() will insert the current date and Now() will insert the current date and time in the Date/Time Data type field. 

Required

You can use this property to specify whether or not a value is required in a field. If this property is set to "Yes" while entering the data in a record, you must enter a value in the field. 

Validation Rule

This rule lets you create an expression which is tested against the data entered. 

For example, You can enter the validation rule for a numeric field as >0 to Disallow the entry of Zero or -ve (negative) numbers. A validation rule, defined as >=date() for date/time field will allow only the current or the next date entries. 

Validation Text

Using this property, you can define the error message which will appear on the screen when the validation rule is not met while entering data. 

For example, If the validation rule is >0 for a numeric field. Then the validation text can be entered as "Incorrect entry" so that whenever zero or a -ve (negative) number in the field. The message "Incorrect entry" is displayed. 

Saving  a Table

After creating a table, you can save it by selecting the Save option from the File menu. Enter the name of the table table in the Save As dialog box and Click on the OK button. 

Inserting Field(s)

To add additional rows (field) - here, Employees Name-in the Design view, follow the steps as given below:

To add a new field (here-Employees Name) int he Design view

1. Open the Table in the Design View

2. Right click in the row above which you want to add a blank row (here-row means the Field structure). The shortcut menu appear. Select the Insert Rows options. 

 3. A blank row will be inserted above the field where your cursor was positioned

4. Specify the field name and data type as required. 

Deleting Field(s)

To delete a row (Field) in the Design view, the steps as follows:

1. Right click in the row which you want to delete (here, row means the field structure)

2. The shortcut menu appears. Select the Delete Row button. 

Primary key For the Table

The primary key is used to define the data in a Field uniquely (there should be no duplicate value). It helps to make the searching process Faster. 

How to Select the Primary Key Field in Data field? 

Since a primary key field a holds the data the uniquely identifies each record in a table, you must look for a field which has unique values.

To understand this, let's assume example:

Put the details of the Employees of batch in the table. Then the Employees number field can be made the primary key field, which is not being duplicated for the entries batch. 

Point:

If you define a primary key field after entering the data in a table, and the field has duplicate value in it, you will get an Error message and will not be able to save the changes until you remove the duplication of the data in the particular field. 

Define the Primary Key:

The Primary key can be defined or removed in the Design View only. To define the Primary Key for a table. 

1. Open the table in the Design view. 

2. Point the cursor in the row that has the field name, which you want for the primary Key. 

3. Click on the Design Tab (it will be automatically selected ). 

4. Click on the Primary Key button on the Toolbar. 

Remove The Primary Key

The Primary key button on the Toolbar is a toggle button. To remove the primary Key from a field. 

1. Open the Table in the Design view

2. Place the cursor in the field name where the primary key has already been applied. 

3. Click on the Design Tab(it will be automatically selected). 

4. Click on the Primary Key button on the Toolbar. 

.... The Primary key sign will disappear from the front of the Field name. 

Post a Comment

0 Comments