Sunteți pe pagina 1din 12

LAB ACTIVITY MS ACCESS SESSION 2 - Creating Sale Record & Sale Items Form

LAB ACTIVITY
MS ACCESS*
SESSION 2

Creating Sale &


Sale Items Form

Table of Contents
2.1. Creating Sale Form ......................................................................................................................................... 2

2.2. Creating Sale Item Form .............................................................................................................................. 11

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 12
LAB ACTIVITY MS ACCESS SESSION 2 - Creating Sale Record & Sale Items Form

2.1. Creating Sale Form

2.1.1. Open sales_000 table and put some data

2.1.2. While the table is opened, click Form in Create tab

2.1.3. Click Form View in Home tab and you will see the form as below. Since this table has
relationship with sale items table, this table is automatically included.

Page 2 of 12
LAB ACTIVITY MS ACCESS SESSION 2 - Creating Sale Record & Sale Items Form

2.1.4. Save the form name to sales_form_000.


2.1.5. In Design View, delete Table.sale_items_000 in the form because we want to create list box to
show sale item list.

2.1.6. Click the Next or Previous button at the bottom of the form. Make sure the data moves
accordingly.

Page 3 of 12
LAB ACTIVITY MS ACCESS SESSION 2 - Creating Sale Record & Sale Items Form

2.1.7.Resize the Text Box. In Design View, you can resize the width of the Text Box

2.1.8. Rename the title and all labels. In Layout View, double click the labels and rename them some
meaningful name.

2.1.9. Change font and font color. In Layout View, select the labels and controls and change the font
and font color.

Page 4 of 12
LAB ACTIVITY MS ACCESS SESSION 2 - Creating Sale Record & Sale Items Form

2.1.10. Put a new picture. Click at default picture in form header, in Design tab, select Insert Image and
Browse your favourite picture.

2.1.11. Special effect of the text box to sunken. Select the Text Box. In Property Sheet, choose Sunken
for Special Effec in Format tab.

Page 5 of 12
LAB ACTIVITY MS ACCESS SESSION 2 - Creating Sale Record & Sale Items Form

2.1.12. Rename form Caption. In Property Sheet, make sure the selection type is Form. In Format tab,
rename the Caption as SALES RECORD.

2.1.13. Hide Record Selector. In Property Sheet, make sure the selection type is Form. In Format tab, set
Record Selector to No.

2.1.14. Change the date format. Select sale date Text Box. In Property Sheet, select Medium Date in
format option.

Page 6 of 12
LAB ACTIVITY MS ACCESS SESSION 2 - Creating Sale Record & Sale Items Form

2.1.15. For customer Combo Box, the control show the customer id, but we want it show customer
name while maintain the value to customer id. To do that, go to Design View and select text box
for customer id. In Property Sheet edit the Column Widths= 0cm;8cm (0cm for first column and
8 cm for second column – making the first column invisible)

2.1.16. Create Previous Record navigation button. In Design View, Click button icon in Design tab and
drag to the form.

2.1.17. Select Record Navigation for Categories and Go to Previous Record for Actions. Click Next.

Page 7 of 12
LAB ACTIVITY MS ACCESS SESSION 2 - Creating Sale Record & Sale Items Form

2.1.18. Select Text, type Previous Record. Click Next

2.1.19. Put the name as btn_sale_previous_000 and click Finish

Page 8 of 12
LAB ACTIVITY MS ACCESS SESSION 2 - Creating Sale Record & Sale Items Form

2.1.20. The summary of the button setting is as below

Categories Record Navigation


Action Go To Previous Record
Display Text: Previous Record
Name btn_sale_previous_000

2.1.21. Using similar setting as Previous Record, create another navigation button for next record as
setting below.

Categories Record Navigation


Action Go To Next Record
Display Text: Next Record
Name btn_sale_next_000

2.1.22. Try to navigate the button and make sure it works.

2.1.23. Add an Operation button for new record as setting below.

Categories Record Operation


Action Add New Record
Display Text
Name btn_sale_new_000

2.1.24. Try to add an icon to your button. Select the button. In Property Sheet set Picture Caption
Arrangement to Right. In Picture option click the […] button. In Picture Builder, choose your
picture and click OK.

Page 9 of 12
LAB ACTIVITY MS ACCESS SESSION 2 - Creating Sale Record & Sale Items Form

2.1.25. Disable the sale id Text Box. Select sale id Text Box. In Property Sheet, set to No for Enabled
option in Data tab.

2.1.26. In order to individually resize the Text Box, you need to remove the layout. Right click sale id
Text box, select Remove Layout in Layout option. Now you can individually arrange the text box
and resize it.

2.1.27. So far, this is the end product of the sale form.

Page 10 of 12
LAB ACTIVITY MS ACCESS SESSION 2 - Creating Sale Record & Sale Items Form

2.2. Creating Sale Item Form

2.2.1. Next task is to create sale item form to be sub form of sale form. By similar instruction as sale
form, try to create the form until it becomes like the interface below.

2.2.2. Briefly, you need to create a form from sale_item_000 table.

2.2.3. Save the form as sale_items_form_000.

2.2.4. Since this is sub form, we don’t need Form Header. In Design View, delete all items in Form
Header and drag the Details to the top.

2.2.5. Delete several text box fields such as sale id and price text box. We don’t want to manually key
in the price because we want the system refers to the set price in product table when we add
the item.

2.2.6. Resize the column width for product id text box so that the combo box shows product name
instead of product id. Refer 2.1.15.

2.2.7. Set the Record Selectors to No and Navigation Buttons to No in Property Sheet. Make sure the
selection type is Form. Refer 2.1.13.

2.2.8. Change some form attribute such as font, font color, text box special effect and disable item id
text box.

2.2.9. The settings of the three buttons are as below.

Categories Record Navigation


Action Go To Previous Record
Display Picture
Page 11 of 12
LAB ACTIVITY MS ACCESS SESSION 2 - Creating Sale Record & Sale Items Form

Name btn_sale_items_pevious_000

Categories Record Navigation


Action Go To Next Record
Display Picture
Name btn_sale_items_next_000

Categories Record Operations


Action Add New Record
Display Picture
Name btn_sale_items_new_000

2.2.10. In Design View, resize the form area. Make sure it fits to the content of the form.

THIS IS THE END OF THE TUTORIAL FOR SESSION 2

Page 12 of 12

S-ar putea să vă placă și