How to get Started Using Microsoft Access Even if You've Never Used it Before by Paul Barnett - HTML preview

PLEASE NOTE: This is an HTML preview only and some elements such as links or page numbers may be incorrect.
Download the book in PDF, ePub, Kindle for a complete version.

CREATING A TABLE

At the database window click ‘Tables’ and then the ‘New button’

 

00001.jpgSelect the design view option

 

00002.jpg

Add your first field and give it a name. It is advisable to make the first field and ID or identifier field. You will see why later, but essentially it is used to link other tables to this one.
Give the field a name – In this case I have used the name CustomerID. I tend to name my fields using no spaces between the words.

00003.jpg

Select the data type. For ID fields it is recommended to use auto number as the data type. The auto number data type will increment your ID by one each time a record is added and saves you having to do this yourself.

Example

John Smith ID = 1
Kate Wilson ID = 2
Joe Bloggs ID = 3

It is also advisable to make an ID field have a Primary Key. This means that the field is unique and will have a unique ID. To do this right click the field name and select ‘Primary Key’ from the menu.

00004.jpg

I will now add in additional fields.

00005.jpg

I have used text as the data type for some fields and they have a length of 50. You can adjust this if you require by clicking on the field name and looking at the properties that appear. For example:

00006.jpgNow save the table by clicking the save button

 

00007.jpgon the menu bar. I am calling it tblCustomer. It is a good idea to prefix tables with the letters ‘tbl’. We can do the same with queries and use ‘qry’ or for forms use ‘frm’.

 

00008.jpgYou now have a customers table to store information.

 

You could open the table and add records in this fashion if you choose.

 

At the database window right click the table name and select ‘Open’

 

00009.jpgYou will then see a table view or what is termed as a datasheet view of your table.

 

00010.jpg

Try typing in the CustomerID field. You will notice that you cannot type in anything there. The reason for this is you set that field to be an Auto number field. It is only MS Access itself that can change values in that field.

Move the cursor along to the other fields and you will find you can type something in.

 

Adding data in this way is fine, but it is not very user friendly or visual. A better way is to use a form.