Sunday, October 3, 2010

Microsoft access tutorial 2

Unit 3. Creating data tables (I)


Here we will see how to create a data table in order to be able to introduce data into the database in the following units, and later work with this data using the advantages provided to us by Access2003.

Creating a data table.

To create a data table we need to position ourselves in the database window with the Tables object selected, if we click on the New button it opens a window with the various available ways of creating a new table:

Datasheet view consists of directly introducing the data into the table, and according to the value introduced into the column determines the type of data that the column has.

Design view is the method we will detail in this unit.

Table wizard guides us step by step in the creation of the table using a predetermined sample table.

Import table consists of creating a new table from an existing one in another database.

Link table consists of creating a reference to another table stored in a different database.

Next we will explain the way to create a table in design view. This method consists in defining the structure of the table i.e define the different columns that it will contain as well as other considerations such as codes, validation rules etc...

Another way to arrive at the design view is from the Database window with the Tables object selected then double clicking on the option Create table in Design view.

The Table design window will appear:

In the title bar we have the name of the table (as we have still not assigned a name to the table, Access has assigned a default name Table1.

Next we have a grid where we define the columns (fields) that compose the table using a line for each column, so in the first row of the grid we will define the first column of the table, in the second row of the grid we will define the second column of the table and so on and so on.

At the bottom left we have two tabs (General and Lookup) to define the properties of the field i.e additional characteristics of the column we are defining.

And on the right we have a box with text to help us with what we need to accomplish.

Unit 4. Modifying data tables (I)


Here we will see the record editing techniques used to modify a table definition as well as the data introduced into it.

Modifying the design of a table.

If we wishmake an alteration in the definition of an existing table (e.g to add, extend or delete an existing column etc...) we need to make a modification in its design.

Open the database where the table we want to modify is found if you are not already there.

Select the table that you want to modify by clicking on it so that its name stands out.

Click on the Design button in the database window.

The Table Design window studied in the previous unit will appear.

To modify a field design, position the cursor over the field to modify, and perform the necessary substitutions.

To add a new field,

go to the end of the table and type in the new field definition.

or,

situate yourself in an already existing field and click on the button in the Table Design bar, in this last case the new field will be inserted before the one in which we are positioned.

To delete a field,

position yourself in the field and click on the button in the Table Design bar.

or,

select the whole row corresponding the field by clicking on its extreme left, and when it stands out press the Del key.

The field, as well as the data stored in it will be erased from the table.

And lastly, save the table.

To practice these operations you can perform the Step by step Exercise Modifying the table design.

Introducing and modifying data in a table.

To introduce data into a table we can choose:

- In Database window, select the table to fill in by clicking on its name and click on the button to open the table.

- In Database window, double click on its name.

- If you are in Table design window, click on the Datasheet button in the Table design bar.

In all three cases the Datasheet window will appear:

Each rows allow us to introduce a record.

Write the value of the first field of the record.

Press ENTER to go to the next field in the record.

Once we have finished introducing all data in fields in the first record, we press ENTER key to introduce the data in the second record.

The moment we change to a different record, the record that we were in will be stored, and it is therefore not necessary to save the records again.

Click on the Close button in the Datasheet window to conclude this table.

If we want to delete an entire record:

Select the record to eliminate by clicking on the box on its extreme left (named record selector).

The record will remain selected.

Press the DEL key on the keyboard or on the button on the Datasheet bar.

Is we need to modify an inserted value all we need to do is situate ourselves over the value and re-tyte it.

If we need to alter something in the tables' structure, we will need to go to Design view by clicking on the button on the Datasheet bar.

To practice these operations you can perform the Step by step Exercise Introduce data.

Moving within a table.

To move around the various records contained in a table we can use the Navigation buttons:

The bar indicates to us which record we are in and the total number of records in the table.

The current record is indicated in the white box.

In the final number where we see of 3, the total number of records is indicated to us.

By clicking on the different buttons we can perform the operations explained next:

to go to the first record in the table.

to go to the previous record in the table.

to go to the next record in the table.

to go to the last record in the table.

To create a new record that is automatically situated at the end of the table.

We can also go directly to a determined record in the following way:

Double clic in the white box where the current record number is situated.

Write the number of the record we want to go to.

Press ENTER.

We can also move around the different fields and records by pressing the ARROW UP, ARROW LEFT, ARROW DOWN, and ARROW RIGHT keys on the keyboard.

No comments:

Post a Comment