Add fields in “Datasheet View”
As we saw in the previous lesson, when we have a blank database, it is equipped with a table. By default, this table is named “Table1”. This remains so until we save the table under a different name.
At the top of the application window, a new tab “Data Sheet” is displayed which we call as a contextual tab. In this tab, we have a number of options to edit our table and we will learn more about them later.
Now we will add fields that we need in this table.
This is the “Album” table so I need, “AlbumID”, “Album Title”, “Group”, “Value”, “Type” and “Location” fields.
The first field that is still called ID, is changed to “AlbumID”.
By default, the data type is set to “Auto Numbering” and the “Unique” check box is checked. This is fine, I am sure that each entry in this field is unique.
To rename a column, double-click the column name and type the name you want for this field.
A second way to change a column name is to right-click and select “Rename Column” at the bottom of the drop-down menu.
To add the next field (“Album Title”) and click the “ENTER” key on your keyboard.
Specify the column name, the appropriate name by double-clicking the column name and typing “AlbumTitle” .
Repeat for each column in our table.
Then you determine the data type for each field, and whether this field is required or not.
By default, this is unchecked, so if you want that something must be entered in this field, you need to check this box.
For the data type, we have different choices.
We have “Text”, what seems clear to me.
We have “Memo”, which allows us to give more text than in a text box.
We have “Numeric”, which obliges us to enter numbers. We can use these in calculations.
Plus a few others. (More about data types in Lesson 11)
I propose the “Text” data type for all fields.
With the exception of the “Value” field, here I choose the “Numeric” type.
I’m going assign a value from 1 to 3 to every song.
I assign 1 as highest rating and 3 as the lowest rating.
When we’ve done, it’s time to store our table
Click on the “Save” button in the “Quick Access” toolbar.
In the dialog that appears, enter a name for your table, in this case “Album”.
Then click the OK button.
Adding fields using “Field templates”
A second way to add fields and this is something new in “Access” 2007, is by clicking on the “New Field” button in the “Data Sheet” contextual tab in the “Ribbon”.
This opens the “Field Templates” panel.
Here we find a list of common names, which already have a layout.
This list is divided into categories.
Click the (+) sign beside the category name to expand it.
Click and drag the field name from the list, to the place where you want it in the table.
The place where the new field will be inserted is indicated by an orange line.
Release the mouse button when you’ve reached the right place.
If you do not find the correct field name, you can choose another which already has the correct format. Then enter the field name.
For example, in the “Field templates” list, you’ll find a field called “Redemption”, but not “Sale”.
To save the formatting for this field, click the “Cost” field twice and then you change the name of any one of them.
Click the X in the top right of the “Field Templates” panel, to close it.
You've completed Lesson 7 START NEXT LESSON