You are on page 1of 37

Practical Learning: 

Creating a Blank Database

1. Start Microsoft Access


2. To start a new database, in the File section and under Available Templates, make sure
Blank Database is selected or click it.
In the right section, set the File Name to Clarksville Ice Cream
3. Click Create to create the new database file

Introduction to Tables

Imagine you create a list of people. The list can be started with names as follows: Bill, James,
Hermine, and Khan. This type of list is considered one-dimensional because all of its items fit in
one category. In order to create a more detailed list, you may want to include these people's
email addresses and probably other related information. If you include these additional pieces of
information in the same category, the list may become confusing. To arrange the list, you would
divide it in categories. Here is an example:

Name Email Address Phone Number Relationship

Bill bill@yahoo.com   Friend

James jamesemail.com (102)399-2893  

Hermine   (101) 447-8384 Cousin

Khan @Khan.com    

Database Object and Fields

A field is an object used to host, hold, or store a piece of information of a database. Before such
an object can perform its function, it must first be created. In the strict sense, the most important
or the most regularly used fields of a database are created on a table, but tables may not be the
friendliest windows to present to a user for data entry. For this reason, fields can and should also
be created on other windows.

The process of making a field available depends on the type of object it will reside on and
probably how the field will be used. This leads to two categories of fields: those that can receive
or store information and those that can only present or display it. All fields of a table, especially
in Microsoft Access, are created to store data. On the other hand, fields on almost all of the other
objects (queries, forms, reports) can be made of combinations of already existing fields of a
table, or they can be created independently of any existing or non-existing data.

Table Layout
Database Object and Fields

A field is an object used to host, hold, or store a piece of information of a database. Before such
an object can perform its function, it must first be created. In the strict sense, the most important
or the most regularly used fields of a database are created on a table, but tables may not be the
friendliest windows to present to a user for data entry. For this reason, fields can and should also
be created on other windows.

The process of making a field available depends on the type of object it will reside on and
probably how the field will be used. This leads to two categories of fields: those that can receive
or store information and those that can only present or display it. All fields of a table, especially
in Microsoft Access, are created to store data. On the other hand, fields on almost all of the other
objects (queries, forms, reports) can be made of combinations of already existing fields of a
table, or they can be created independently of any existing or non-existing data.

Table Layout

Introduction to Table Creation


 
Table Creation
To have a table as part of your database, you must create it. You have various options. If you
create a database using one of the local templates, it would provide you with a few tables that
you can start using. Otherwise, to create a table, on the Ribbon, you can click Create. In the
Tables section, click Table. This would cause the Ribbon to switch to a

now how to use a scroll bar.

Table Navigation Buttons

The lower left side of the table is made of four buttons used to navigate the table, one button
used to create a new record, and a text box. Each button plays a specific role:

Button Name Role


Allows moving to the first record of the
First Record
table
Allows you to move one record back (if
Previous Record
there is one) from the current record
Displays the number representing the current
Current Record
record out of the total number of records
Next Record Allows moving you one record ahead
Allows moving you to the last record of the
Last Record
table
 New (Blank) Record Used to enter a new record on the table
 
Introduction to Table Creation
 
Table Creation

To have a table as part of your database, you must create it. You have various options. If you
create a database using one of the local templates, it would provide you with a few tables that
you can start using. Otherwise, to create a table, on the Ribbon, you can click Create. In the
Tables section, click Table. This would cause the Ribbon to switch to a section labeled Fields:

From the Fields tab, you can make selections.

Practical Learning: Creating a Table

1. Open the Rockville Technologies database created in the previous lesson


2. On the Ribbon, click Create
3. In the Tables section, click Table

The Name of a Table

Like everything that is part of a database, a table must have a name that can be used to refer to
that object throughout the database and in other files that can be linked to the table. There are
two main ways you can specify the name of a table, either when you save it for the first time or if
you decide to rename it.

To save a table you have just created:

 You can click File and click Save


 You can right-click the Table_X (such as Table1) tab and click Save
 You can press Ctrl + S
 You can start closing the table. You would be prompted to save the change (if its
structure has been changed from the structure it had before it was opened)

If a table has not been saved before, you will be asked to provide a name for the table. A table
can have almost any name: Employees, 2&&4DG, Pestes, verTT#@tg, etc. Because you and
your users should be able to easily identify a table, there are suggestions you should follow when
naming it:

 The name of a table should reflect the kind of data it is holding


 You can name a table with a few words, with spaces
 You can use a prefix that identifies the table as such, a table. The name of a table would
be preceded with tbl. If the name includes one word, such as Musicians, you can give the
table a name like tblMusicians, another name would be tblStudents
 If the name of the table reflects a combination of words, such as Bank Accounts or
Students Academic Numbers, you should start each new word with an uppercase. Here
are examples: tblBankAccounts, tblStudentAcademicNumbers, tblMemberRegistrations.

In our lessons, we will not use the convention of prefixing the name of a
database object with three letters. For example, the names of tables will not
start with tbl. We came to this decision because most other database
environments, including Microsoft SQL Server, do not suggest this rule.
Although the lack of this rule may create some confusion, because you will end
up having a table and a form with the same name, we will strive to explicitly
state what object type we are referring to. For example, we will avoid writing,
"Open Employees" or "Open the Employees object". Instead, we will usually
state, "Open the Employees table".
 
Practical Learning: Saving a Table

1. To save the table, right-click Table1 and click Save


2. Type Corporate Items as the name of the table
 

3. Click OK
4. To close the table, click its Close button

Table Management
 
The Tables in the Navigation Pane
Because the table is the primary object of a database, when you create a table and save it by
giving it a name, Microsoft Access creates a section labeled Tables in the Navigation Pane and
displays the name of thew new table in that section. In the same way, you can have as many
tables as possible in the Tables section. Here is an example:

As we will see in the next lesson, you can create other object and they will have their sections.
Each section is expandable and collapsible. To expand a section, click the header of that section.
To the same to collapse a section.

Opening a Table

The most regular operations you will perform on a table require that you open it first. To open a
table, first locate it in the Navigation Pane then:

 You can double-click the table


 You can right-click the table and click Open

Any of these actions causes the table to display in Datasheet View in the central area of the
screen. In the same way, you can open as many tables as necessary.

Closing a Table

After using a table, you can close it. Before closing a table, first select its tab. Then, to close a
table:

 You can click the close button on the right side of the tabs
 You can press Ctrl + Shift + F4

Selecting a Table

In order to use a table, some operations require that you (or rather the user) first select(s) it:

 To select a table in the Navigation Pane, simply click it


 If you had opened many tables and they are displaying in the main area of the screen, to
select one, click its tab or its title bar
 If you have many tables displaying in the main area of the screen, you can press Ctrl + F6
continuously to switch from one table to the next until the desired one displays

Renaming a Table

We saw that, when or after creating a table, you must save it to make it part of your database.
When saving it for the first time, you must give it a name. If the name of a table is not
appropriate, you can change it. To rename a table, in the Navigation Pane, you can right-click the
name of the table and click Rename.

Practical Learning: Renaming a Table

1. In the Navigation Pane window, right-click the Corporate Items table and click Rename
2. Type Employees Resources as the new name of the table
3. Press Enter

Deleting a Table

If you have a table you don't need anymore, you can remove it from your database. Because you
cannot delete a table if it is opened, you must first close it.

To remove a table from your database:

 In the Navigation Pane, right-click the table and click Delete


 In the Navigation Pane, click the table to select it. Then, on the Ribbon, click Home. In
the Record section, click Delete
 In the Navigation Pane, click the table to select it and press Delete

In each case, you will receive a warning to confirm what you want to do. It is important to know
that if you delete a table, because it is not a file, it does not go into the Recycle Bin: it is lost,
including its records. Therefore, before deleting a table, make sure you really want to get rid of
it. When in doubt, do not delete it.

Practical Learning: Deleting a Table

1. In the Navigation Pane, right-click the Employees Resources table


2. Click Delete
3. Read the warning of the message box and click Yes
Practical Learning: Saving a Table

1. To save the table, right-click Table1 and click Save


2. Type Corporate Items as the name of the table
 

3. Click OK
4. To close the table, click its Close button

Table Management
 
The Tables in the Navigation Pane

Because the table is the primary object of a database, when you create a table and save it by
giving it a name, Microsoft Access creates a section labeled Tables in the Navigation Pane and
displays the name of thew new table in that section. In the same way, you can have as many
tables as possible in the Tables section. Here is an example:

As we will see in the next lesson, you can create other object and they will have their sections.
Each section is expandable and collapsible. To expand a section, click the header of that section.
To the same to collapse a section.

Opening a Table

The most regular operations you will perform on a table require that you open it first. To open a
table, first locate it in the Navigation Pane then:
 You can double-click the table
 You can right-click the table and click Open

Any of these actions causes the table to display in Datasheet View in the central area of the
screen. In the same way, you can open as many tables as necessary.

Closing a Table

After using a table, you can close it. Before closing a table, first select its tab. Then, to close a
table:

 You can click the close button on the right side of the tabs
 You can press Ctrl + Shift + F4

Selecting a Table

In order to use a table, some operations require that you (or rather the user) first select(s) it:

 To select a table in the Navigation Pane, simply click it


 If you had opened many tables and they are displaying in the main area of the screen, to
select one, click its tab or its title bar
 If you have many tables displaying in the main area of the screen, you can press Ctrl + F6
continuously to switch from one table to the next until the desired one displays

Renaming a Table

We saw that, when or after creating a table, you must save it to make it part of your database.
When saving it for the first time, you must give it a name. If the name of a table is not
appropriate, you can change it. To rename a table, in the Navigation Pane, you can right-click the
name of the table and click Rename.

Practical Learning: Renaming a Table

1. In the Navigation Pane window, right-click the Corporate Items table and click Rename
2. Type Employees Resources as the new name of the table
3. Press Enter

Deleting a Table

If you have a table you don't need anymore, you can remove it from your database. Because you
cannot delete a table if it is opened, you must first close it.

To remove a table from your database:

 In the Navigation Pane, right-click the table and click Delete


 In the Navigation Pane, click the table to select it. Then, on the Ribbon, click Home. In
the Record section, click Delete
 In the Navigation Pane, click the table to select it and press Delete

In each case, you will receive a warning to confirm what you want to do. It is important to know
that if you delete a table, because it is not a file, it does not go into the Recycle Bin: it is lost,
including its records. Therefore, before deleting a table, make sure you really want to get rid of
it. When in doubt, do not delete it.

Practical Learning: Deleting a Table

1. In the Navigation Pane, right-click the Employees Resources table


2. Click Delete
3. Read the warning of the message box and click Yes

Using a Sample Field

When you start a table in the Datasheet View, the Ribbon becomes equipped with a new tab
labeled Fields. The sample fields and their configurations are distributed in various sections. One
of the sections of the Fields tab is named Add & Delete:

Microsoft Access provides many pre-configured fields you can add to your table. These ready-
made sample columns are referred to as a Field Templates. To use a field template, while the
table is displaying in Datasheet View:

 Click or right-click the header of a column. This would bring a menu from where you can
select an option
 On the table, click the header column or a cell under the column. In the Add & Delete
section of the Fields tab of the Ribbon, click the type of field you want
 In the Add & Delete section of the Ribbon, click More Fields to display a list and click an
option from that menu
 

Practical Learning: Using Fields

1. Click File
2. In the list of previously opened databases, click Clarksville Ice Cream
3. To create a new table, on the Ribbon, click Create
4. In the Tables section, click Table
 

5. Click Click To Add and click Text


6. When it is highlighted, type Order Date and press Enter
 

7. As the menu displays in the next column, click Text


8. Type Order Time and press Enter
9. As the menu appears in the next column header, click Text
10. Type Container and press Tab
11. Press Esc
 

12. Close the table


13. When asked whether you want to save it, click Yes
14. Type Customers Orders as the name of the table
15. Click OK
16. To start a new table, on the Ribbon, click Create
17. Click Table

18. In the Add & Delete section, click Text


19. Type Manufacturer and press Enter
20. Press Esc

21. In the Add & Delete section, click Text


22. Type Model and press Enter
23. Press Esc
24. In the Add & Delete section, click Date & Time
25. Type Acquired Date and press Enter
26. Press Esc

27. In the Add & Delete section, click Currency


28. Type Purchase Price and press Enter
29. Press Esc

30. In the Add & Delete section, click Text


31. Type Company and press Enter
32. Press Esc
33. Right-click Table1 and click Save
34. Set the name to Company Assets
35. Click OK
36. Click its Close button

Columns Maintenance in the Datasheet View


 
Importing a Table and its Columns

Although a column completely depends on a table, both objects are closely related when it comes
to their maintenance. In other words, the maintenance performed on one object can directly
affect the other. For example, you can import a table from a text file or from another application.
A table cannot exist without at least one column.
Selecting a Column

Some operations will require that you select a column but it depends on the operation you want
to perform. In some cases, when any cell under a column has focus (for example if the caret is
blinking in a cell of a column), the column is considered to be selected. Otherwise:

 To select one column, position the mouse on its name until the cursor points down and
then click
 

 To select columns in a range, click and hold your mouse on one of them, then drag to the
left or to the right to cover the other desired column or columns. When all desired
columns are highlighted, release the mouse
 To select a range of columns, click one column that will be at one end, press and hold
Shift, then click the column that will be at the other end, and release Shift

Changing the Width of a Column

If you create a table using one of the Table Templates or if you get a table from a Database
Template, the columns of the tables are wide enough to show their names. If  you create a table
from scratch in the Datasheet View, Microsoft Access assigns it a default width. That width can
appear to be too narrow or too wide. For example, when data exceeds the regular width of a
column, part of the information would be hidden. If a particular column contains data that you
want to display at all times, you can enlarge the column. On the other hand, if a column displays
tinny pieces of information, you can narrow the column to let it just fit the data as desired. There
are various techniques you can follow to widen or narrow a column.

To change the width of a column:

 you can position the mouse on the right border of a column header. The mouse pointer
would change into a horizontal double arrow crossed by a vertical line:
 

 
If you double-click, the column would be resized to the widest value of the column,
provided the widest value is wider than the column header. If the widest value is
narrower than the column header, the column width would be widened enough to display
the name of the column.
 You can click the column's right border and drag in the desired direction, left or right
until you get the desired width
 

 You can right-click a column's name and click Column Width... This would open the
Column Width dialog box where you can type the desired value and click OK
 

Moving a Column

If you find out that a particular column is misplaced in a table, you can change its position.

To move a column in Datasheet View, first select it. Click and hold your mouse on it. Then, start
dragging left or right in the desired direction. While your mouse is moving, a thick vertical line
will guide you. Once the vertical line is positioned to the desired location, release the mouse:

To move a group of columns, first select them as we reviewed earlier. Click and hold the mouse
on one of the selected columns. Start dragging left or right in the desired direction until the thick
vertical guiding line is positioned in the desired location, then release the mouse:
Inserting a Column

Inserting a column consists of adding one between two existing fields. To do this, right-click the
column that will succeed it and click Insert Field

Practical Learning: Inserting a Column

1. The Clarksville Ice Cream database should still be opened.


In the Navigation Pane, double-click the Customers Orders to open the table
2. To add a new field, right-click the Order Date column header and click Insert Field
3. Click the cell under Order Time
4. In the Add & Delete section of the Ribbon, click Text

Renaming a Column

To rename a column, you must put it into edit mode. To do this:

 Double-click the name of the column in the header


 Right-click the column's name and click Rename Field

Once the name is in edit mode, type the desired name and press Enter.

Practical Learning: Renaming a Column

1. The Clarksville Ice Cream database should still be opened.


Right-click the Field1 column header and click Rename Field
2. Type Clerk and press Enter
3. Right-click Field2 and click Rename Field
4. Type Flavor and press Enter
5. Close the table

Hiding and Revealing a Hidden Column

If a table contains many columns and at one time you think you don't need all of them, you can
hide some. To hide a column, you can drag the right border of its column header completely to
its left border as we saw earlier to change the width of a column; when the vertical guiding line
reaches the left border, release the mouse: the column would be hidden from the table:
 

To hide one or a group of columns, you can right-click and click Hide Fields. You can also right-
click any column and click Unhide Fields. This would open the Unhide Columns dialog box.
Here is an example:

To hide a column, clear its check box.

To reveal a column or a group of columns previously hidden, right-click any column header on
the table and click Unhide Column. In the Unhide Columns dialog box, put a check mark on
each column you want to show.
Deleting a Column

If you have an undesirable column in a table, you can delete it. It is important to keep in mind
that if you delete a column, it also goes with any information under it.

To remove a column from a table:

 Right-click the column's name and click Delete Field


 Select the column (or a group of columns), right-click anywhere in the table and click
Delete Field
 Select a column (or a group of columns). Then, in the Add & Delete section of the

Ribbon, click the Delete button

Any of these actions would present you a warning to confirm whether you still want to delete the
column(s) or you want to change your mind. If you still want to

Practical Learning: Creating a Numeric Lookup Field

1. Start Microsoft Access


2. Create a Blank Database
3. Set the name of the database as Bethesda Car Rental2 and click Create
4. On the default table, click Click to Add and select Text
5. While Field1 is still selected, type Category and press Enter
6. Save the table as Categories and switch it to Design View
7. Complete the table as follows:
 

Field Name Data Type Caption Field Size Format


CategoryID (Primary Key) AutoNumber Category ID    
Category Text   50  
Daily Number   Double Fixed
Weekly Number   Double Fixed
Monthly Number   Double Fixed
Weekend Number   Double Fixed

8. Save the table and close it


9. On the Ribbon, click Create and, in the Forms section, click Form Design
10. Save the form as Rental Rates and change the following characteristics in the Property
Sheet:
Record Source: Categories
Caption: Rental Rates
Default View: Continuous Forms
Navigation Buttons: No
11. Design the form as follows (don't try to match the fonts; use whatever font you have on
you


On the Ribbon, click Create and, in the Forms section, click Form Design

 Save the form as Rental Rates and change the following characteristics in the Property Sheet:
Record Source: Categories
Caption: Rental Rates
Default View: Continuous Forms
Navigation Buttons: No
 Design the form as follows (don't try to match the fonts; use whatever font you have on your
computer):
 

 Save the form and switch it to Form View


 Create the following records:
 
Category Daily Weekly Monthly Weekend
Economy 34.95 28.75 24.95 24.95
Compact 38.95 32.75 28.95 28.95
Standard 45.95 39.75 35.95 34.95
Full Size 50.00 45.00 42.55 38.95
Mini Van 55.00 50.00 44.95 42.95
SUV 56.95 52.95 44.95 42.95
Truck 62.95 52.75 46.95 44.95
Van 69.95 64.75 52.75 49.95
 Click Condition and, in the bottom section of the table, click the Lookup tab. Change the
properties as follows:
Display Control: Combo Box
Row Source Type: Value List
Row Source: "Excellent";"Good Shape";"Needs Repair";"Must be Retired"
Bound Column: 1
Column Count: 1
Column Widths: 1"
List Width: 1"

 Save the table as Cars and close the table


 Create a new table in Design View as follows:
 
Field Name Data Type Caption Field Size
EmployeeID (Primary Key) AutoNumber Employee ID  
EmployeeNumber Text Employee # 20
FirstName Text First Name 50
LastName Text Last Name 50
Title Text   100
Notes Memo    
 Save the table as Employees and close it
 Create a form for the Employees table, save it as Employees, and design it as you see fit.
Here is an example:
 
 Save the form and create the employees
 Close the form
 Create a new table in Design View with the following fields:


Save the table as Customers and close it

 Create a form for the Customers table, save it as Customers, and design it as you see fit.
Here is an example:
 
 Save the form
 Create some customers before closing the form
 Create a new table in Design View with the following fields:
 
Field Name Data Type Caption Field Size Other Properties
RentalOrderID (Primary Rental Order
AutoNumber    
Key) ID
Long
EmployeeID Number Processed By  
Integer
Long
CustomerID Number Processed For  
Integer
Long
CarID Number Car  
Integer
CarCondition Text Car Condition 50  
TankLevel Text Tank Level 50  
MileageStart Number Mileage Start Integer  
MileageEnd Number Mileage End Integer  
TotalMileage Number Total Mileage Integer  
StartDate Date/Time Start Date    
EndDate Date/Time End Date    
TotalDays Number Total Days Integer  
RateApplied Number Rate Applied Double Format: Fixed
Format: Percent
TaxRate Number Tax Rate Double
Default Value: 7.50
Default Value:
OrderStatus Text Order Status 50
"Unknown"
Notes Memo    
 Click TankLevel and, in the bottom section of the table, click the Lookup tab. Change the
properties as follows:
Display Control: Combo Box
Row Source Type: Value List
Row Source: "Empty";"1/4 Empty";"Half";"3/4 Full";"Full"
Bound Column: 1
Column Count: 1
Column Widths: 1"
List Width: 1"
 Click OrderStatus and, in the bottom section of the table, click the Lookup tab. Change the
properties as follows:
Display Control: Combo Box
Row Source Type: Value List
Row Source: "Unknown";"Car On Road";"Order Completed";"Order Reserved"
Bound Column: 1
Column Count: 1
Column Widths: 1"
List Width: 1"
 Save the table as RentalOrders
 Close it 

The Relationships Diagram

Tables and fields relationships can be created and managed in a special window called the
Relationships window. To display it:
 If no table is currently opened, on the Ribbon, click Database Tools. In the Show/Hide

section, click the Relationships button


 If a table is currently displaying, on the Ribbon, click Table. In the Relationships section,

click the Relationships button

After clicking one of those:

 If no relationship exists among the tables in the current database, the Show Table dialog
box would come up, asking you to select the tables whose relationship(s) you want to
create. To add a table, select it, click Add and click Close
 If at least one relationship has been created between two tables, the Relationships
window would come up and display that relationship or the already existing relationships

When you are working on the relationships of your tables, a window with a tab labeled
Relationships displays in Microsoft Access. Also, the Ribbon is equipped with a tab labeled
design and that includes two sections:

The Design tab of the Ribbon provides various tools to assist you with creating and managing the
relationships. For example, if the Show Table dialog box has been closed and if you want to
show it:

 You can click the Show Table button on the Ribbon


 You can right-click the body of the Relationships window and click Show Table...

You can create a relationship only between two tables that are present on the Relationships
window. This means that even if a table is part of your database and you want to link it to
another table (of your database), if the table has not been added to the Relationships window,
you cannot create or manage its relationship to another table. Of course, there are other ways you
can create relationships without using the Relationships window but the Relationships window
gives you detailed means of creating and managing relationships.
To establish a relationship that does not yet exist between two tables, you can drag the primary
key from the parent table to the foreign key of the desired table. If you drag and drop accurately,
the relationship would be acknowledged and you can just click Create to make it formal. If you
dropped the primary key on the wrong field, you would have time to select the appropriate fields
in the Edit Relationship dialog box.

Practical Learning: Establishing Tables Relationships

1. The Bethesda Car Renatal2 database should still be opened.


On the Ribbon, click Database Tools

2. In the Show/Hide section, click the Relationships button . The Show Table
property sheet comes up:
 

3. Click Categories
4. Click the Add button 
5. Double-click Cars
6. On the Show Table dialog box, click the Close button
7. To add another table as if we forgot it, right-click an empty area in the Relationships
window and click Show Table...
8. In the Show Table dialog box, click Customers
9. Press and hold Shit
10. Click RentalOrders and release Shift
11. Click Add and click Close
12. Drag the CategoryID field from the Categories table and drop it on top of the CategoryID
field in the Cars table:
 

 
The Edit Relationship dialog box would come up
 

13. Click Create


14. Now you have a line relating these two tables.
Drag any field from the Cars table and drop it on top of any field in the RentalOrders
table if you missed the target
 

15. Once again, the Edit Relationship dialog box comes up.
On the dialog box, under the left Table/Query, click the field that is selected to display its
combo box. In that left combo box, select CarID and press Tab
16. Under Related Table/Query, click the field that is selected. Click the arrow of its combo
box and select CarID
 

 
17. Click Create
18. In the same way, drag EmployeeID from the Employees table and drop it on EmployeeID
in the RentalOrders table
Click Create
In the same way, drag EmployeeID from the Employees table and drop it on EmployeeID in the RentalOrders
table
Click Create
Drag CustomerID from the Customers table and drop it on CustomerID in the RentalOrders table
Click Create
 

 
 

On the Relationships section if the Ribbon, click the Close button


When asked whether you want to save, click Yes

 
-Datasheet
You can also expand all records. To do this, open the table in Datasheet View. In the Records
section of the Home tab of the Ribbon, click More -> Subdatasheet -> Expand All

Practical Learning: Introducing Subdatasheets

1. To start a new database, press Ctrl + N


2. Set the File Name of the database to Video Collection3 and click Create
3. Close the default table without saving it
4. To create a new table, on the Ribbon, click Create
5. In the Tables section, click the Table Design
6. Set the name of the first field to ActorID and set its Data Type to AutoNumber
7. While the field is still selected, in the Tools section of the Ribbon, click the Primary Key

button
8. Set its Caption to Actor ID
9. In the upper section of the table, under ActorID, create a new field as follows:
Field Name: Actor
Data Type: Text
Field Size: 50
10. Set the last field as Notes with a Memo as Data Type
 

11. To switch the table to the other view, on the Ribbon, click the View button
12. When you are asked whether you want to save the table, click Yes
13. Type Actors and press Enter
14. Press Enter and enter the following names of actors:

Practical Learning: Creating a Sub-Datasheet

1. Create a new table in Design View with the following fields:


 

Field Name Data Type Caption Field Size


VideoID (Primary Key) AutoNumber Video ID  
Title Text   120
DirectorID Number Director Long Integer
CopyrightYear Number © Year Integer
Length Number   Integer
GenreID Number Genre Long Integer
CategoryID Number Category Long Integer
Rating Text   20
Notes Memo    

2. (To get the © character, you can open Microsoft Word, type (c) then select and copy it.
Then paste it in the Caption property of the table field)
3. Save the table as Videos and switch it to Datasheet View 
4. Enter a few videos:
 

©
Video ID Title Director Length Genre Category Rating
Year
1 Distinguished Gentleman (The) 8  112 2 3R
2 Wall Street 12 1987 126 1  R
3 Ransom 4  121 1  R
4 Not Another Teen Movie 11 2005 100 2 4 Unrated
5 Harlem Nights 6 1989 116 2  R
6 M:i:III 7 2006 125 1 6 PG-13
7 Devdas 5   175 13   Unrated
8 Passion of the Christ (The) 9 2004   12  R
9 Platoon 12 1986 120 3  R
10 Day After Tomorrow (The) 1 2004 123 1 5 PG-13
11 Beautiful Mind (A) 4 2001 135 1  PG-13

 Save the table and close it

 From the Navigation Pane, double-click Directors: Table to open it


 On the Ribbon, click Home. In the Records section, click More -> Subdatasheet ->
Subdatasheet...
 In the Insert Subdatasheet dialog box, make sure the Tables tab is selected. In the list box,
click Videos and notice that DirectorID has been selected in the combo boxes:
 

 Click OK
 

 A message box information informs you and asks whether you want to create a relationship
between both tables. Read it and click Yes

 Click a + button and notice the related records. Close the Directors table
 

You might also like