Lab Activity
Lab Activity
LAB ACTIVITY
MS ACCESS*
SESSION 6
Creating Reports
Table of Contents
6.1. Producing Sales Receipt ..................................................................................................................... 2
In this guideline, you can see the name for tables, field of tables,
forms, queries, reports, macros and controls end with 000. REPLACE
the 000 with last three digit of your MATRIC NUMBER
* Best version Ms Access 2010
Page 1 of 15
LAB ACTIVITY MS ACCESS SESSION 5 – Creating Reports
Field
Total:[item_quantity_000]*
customer_name_000
product_name_000
item_quantity_000
[item_price_000]
item_price_000
sales_date_000
sale_id_000
Table
sale_items_000
sale_items_000
sale_items_000
customers_000
products_000
sales_000
Sort Ascending
sales_form_000
Page 2 of 15
LAB ACTIVITY MS ACCESS SESSION 5 – Creating Reports
6.1.4. As you can see, sale id, sale date and customer name is the same for the
five items, so we just want to have one only. This can be done by
locating the three type of information in Page Header in Design View.
6.1.5. For now, you can delete sale id, sale date and customer name in Detail
section.
6.1.6. Next, make the page header wider by draging down the Detail section.
Click Add Existing Fields icon. You can see the available field here. Drag
sale id, sale date and customer name to Page Header section.
Page 3 of 15
LAB ACTIVITY MS ACCESS SESSION 5 – Creating Reports
6.1.7. Delete the total for item price and make total for Total field. Select Total control in
Detail section, right click. Select Total and Sum.
6.1.8. In order to make numbering for sale item, create another Text Box. Put the name as
numbering_000 at Other tab in Property Sheet. Select the text box, in Property Sheet
in Data tab, put =1 in Control Source and Over All for Running Sum option as shown
below.
Page 4 of 15
LAB ACTIVITY MS ACCESS SESSION 5 – Creating Reports
6.1.10. You can change the logo, make the Text Boxes border to transparent. Change the font
and font color, date format and grand Total format to Currency.
Page 5 of 15
LAB ACTIVITY MS ACCESS SESSION 5 – Creating Reports
6.1.11. Finally, we want to create a button to show this report. The setting is as
below.
Page 6 of 15
LAB ACTIVITY MS ACCESS SESSION 5 – Creating Reports
Sort
6.2.4. Make sure the Drop Zone and Field List is selected.
6.2.5. In Chart Field List, select item_price_000. In bottom combo box choose Data Area and
click Add to button.
Page 7 of 15
LAB ACTIVITY MS ACCESS SESSION 5 – Creating Reports
6.2.7. Click Property Sheet. In General tab, make sure the Select option is Chart Workplace.
Page 8 of 15
LAB ACTIVITY MS ACCESS SESSION 5 – Creating Reports
6.2.9. In the same Properties box, Select option in General tab, select Title.
6.2.10. Click Format tab, and rename the caption and change other format.
Page 9 of 15
LAB ACTIVITY MS ACCESS SESSION 5 – Creating Reports
Page 10 of 15
LAB ACTIVITY MS ACCESS SESSION 5 – Creating Reports
6.3.2. The different is the query which is just like below. Refer Tutorial 5.2 on how to make query that
has total.
6.3.3. Make sure sale_000 is added to link between the customer and sale items table.
Sort Descending
6.3.5. Add SumOf item_price_000 in Data Area and customer_name_000 in Category Area.
Page 11 of 15
LAB ACTIVITY MS ACCESS SESSION 5 – Creating Reports
Sort Descending
6.4.4. Add SumOf item_price_000 in Data Area and product_name_000 in Category Area.
Page 12 of 15
LAB ACTIVITY MS ACCESS SESSION 5 – Creating Reports
6.5.2. Set some basic properties as you wish and save as menu_000.
6.5.3. Firstly, we want a button that opens sale_form_000 form. Set the setting of the
button as below.
6.5.5. Next, create another button to open sale by month report as setting
below.
Categories Miscellaneous
Action Run Query
Query Name report_sale_by_month_000
Display Text: SALES BY MONTH
Name sales_by_month_000
6.5.9. By the similar setting, create another two buttons to open sale by customer and sale
by product report.
Categories Miscellaneous
Action Run Query
Query Name report_sale_by_customer_000
Display Text: SALES OF CUSTOMERS
Name sales_by_customers_000
Categories Miscellaneous
Action Run Query
Query Name report_sale_by_products_000
Display Text: SALES BY
Name PRODUCTS
sales_by_products_000
Page 14 of 15
LAB ACTIVITY MS ACCESS SESSION 5 – Creating Reports
6.5.10. Now, we want to make this menu form as default form opened when we open this
file.
6.5.13. Close the file and reopen it. Make sure the menu form is open by default.
Page 15 of 15