Lab Activity
Lab Activity
LAB ACTIVITY
MS ACCESS*
SESSION 1
Contents
1.1. Creating Table ................................................................................................................................................ 2
In this guideline, you can see the name for tables, fields of table,
forms, queries, reports, macros and controls end with 000. REPLACE
the 000 with last three digit of your MATRIC NUMBER
Page 1 of 16
LAB ACTIVITY MS ACCESS SESSION 1 - Creating Table, Table Relationship, Query
1.1.2.To add/edit the field, click Home tab and choose Design View
Page 2 of 16
LAB ACTIVITY MS ACCESS SESSION 1 - Creating Table, Table Relationship, Query
1.1.4. If you accidently put the table with different name, close the table first and right click the table
in Navigation Pane, choose rename.
(to close the table, right click at Table1 and click Close)
Page 3 of 16
LAB ACTIVITY MS ACCESS SESSION 1 - Creating Table, Table Relationship, Query
sale_id_000 AutoNumber
customer_id_000 Number
sale_date_000 Date/Time
1.1.6. You also can set more Field Properties – Example: Data Type Number has several
properties such as Format (General Numbers, Currency, Percent) by clicking General
tab in Field Properties. In this case, you can choose General Number or leave it
blank.
1.1.7.Primary key (key icon) – in this case sales_id_000 is normally set to AutoNumber
Page 4 of 16
LAB ACTIVITY MS ACCESS SESSION 1 - Creating Table, Table Relationship, Query
item_id_000 AutoNumber
sales_id_000 Number
product_id_000 Number
item_quantity_000 Number
item_price_000 Currency
customer_id_000 AutoNumber
customer_name_000 Text
customer_phone_000 Text
product_id_000 AutoNumber
product_name_000 Text
Page 5 of 16
LAB ACTIVITY MS ACCESS SESSION 1 - Creating Table, Table Relationship, Query
product_price_000 Currency
1.1.10. Fill in some data in customers_000 table as example below (you can also put your own data). At
Home tab, choose Datasheet View to enter the data.
customer_name_000 customer_phone_000
1.1.11. Fill in some data in products_000 table as example below (you can also put your own data)
product_name_000 product_price_000
Mouse 15.00
Keybord 55.00
Monitor 500.00
Scanner 45.00
Page 6 of 16
LAB ACTIVITY MS ACCESS SESSION 1 - Creating Table, Table Relationship, Query
1.2.1. Before you create table relationship, make sure the tables you want to relate with is closed. Click
Database Tools tab and choose Relationship
1.2.3. In this case, we see sales_000 table has foreign key of customer_id_000 that has
relationship with customer_id_000 in customers_000 table.
Page 7 of 16
LAB ACTIVITY MS ACCESS SESSION 1 - Creating Table, Table Relationship, Query
Page 8 of 16
LAB ACTIVITY MS ACCESS SESSION 1 - Creating Table, Table Relationship, Query
Page 9 of 16
LAB ACTIVITY MS ACCESS SESSION 1 - Creating Table, Table Relationship, Query
1.3.3. Drag down or double click field that you wish to have. In this example, you need to
select customer_id_000 field and customer_name_000 field. You can sort the list
according to customer name
Page 10 of 16
LAB ACTIVITY MS ACCESS SESSION 1 - Creating Table, Table Relationship, Query
Sort Ascending
Page 11 of 16
LAB ACTIVITY MS ACCESS SESSION 1 - Creating Table, Table Relationship, Query
1.3.7. Create another query by name list_of_product_000 using the setting as below.
Sort Ascending
Page 12 of 16
LAB ACTIVITY MS ACCESS SESSION 1 - Creating Table, Table Relationship, Query
1.4.2. Open sales_000 table in Design View. Click Data Type of customer_id_000 field.
1.4.3. In Field Property, choose Lookup tab. Choose Combo Box option for Display/Control.
1.4.4. More option will appear in Field Property. Set Row Source Type to Table/Query.
1.4.5. You will see an option list_of_customer_000 is added to the Row Source. Select that option.
Page 13 of 16
LAB ACTIVITY MS ACCESS SESSION 1 - Creating Table, Table Relationship, Query
1.4.6. Since this query has two columns, set some of options as below.
Column Count 2
Page 14 of 16
LAB ACTIVITY MS ACCESS SESSION 1 - Creating Table, Table Relationship, Query
1.4.7. Save the Table and open Datasheet view to see the result. You can select
from Combo Box from customer_id_000 field and the system just stores
customer id after you selected.
1.4.8. Now you have created combo box in sales_000 table. Repeat step 1.4.1 to 1.4.7 to
create combo box in product_id_000 field of sale_item_000 table using
list_of_product_000 query that you have created in 1.3.7.
Page 15 of 16
LAB ACTIVITY MS ACCESS SESSION 1 - Creating Table, Table Relationship, Query
Page 16 of 16