SECTION 2
Lesson 2.3: Creating A Table

   

 

 

Once you have established what data needs to be in your database, constructing a Table using the Design view of Access is a snap. Name your field, give it a data type, leave a note for yourself and others describing the purpose of the field if you like, and that’s all there is to it.

Double-click the Create Table in Design view link in the Database window. A new window will appear; the new table will be called Table1 until you give it a name:

 

 

If you want to make a database containing a listing of all the plants that you own, Access makes construction easy. First, the planning stage – what information would be useful in a plant database? The name, genus and species, how much light it should get, when it was last fertilized, and when it should be fertilized again.

These are all good things to have in a table, but what about a primary key? If your database is going to be just this one table, then there really is no need for a primary key. But if your collection of plants is large and varied, you might want to have a primary key to relate to other tables if you keep a listing of greenhouses that sell plants and what fertilizers to use. Therefore we will use the AutoNumber data type as the primary key on this table to keep it orderly.

With the cursor in the first cell under the heading Field Name, we will name the field Plant ID. Pressing the Tab key puts the cursor in the adjacent cell under the Data Type header. The default data type is text, but let’s click the pull-down arrow to see the list of possible data types:

 

 

The majority of data types you will use will be Text and Number, but Access provides the functionality to use just about any data or file type, including files that aren’t even on your own computer. Consult Access’ help file for information about non-standard data types; they are beyond the scope of this manual.

To the right of the Data Type field is the Description field where you can write a note about the purpose of each field. It is optional and does not affect the usage of the database.

For our example, pick AutoNumber from the pull-down menu. We also want this to be the primary key, and we will set this property manually. Right-click on Plant ID and then select Primary Key from the pop-up menu:

 

 

Plant ID will now have a small key () beside it denoting this field as the primary key. We can then fill in the rest of the fields like this: