database design lab: ms access formswidit.knu.ac.kr/~kiyang/teaching/db/s17/labs/lab6.pdfdatabase...

10
Database Design Lab: MS Access Forms 1. Download “lab5.accdb” and rename it to “lab6.accdb”. 2. View the Relationship (Database Tools tab) to get an overview of the data model. 3. Create a data entry form for the “Author” table. a) Select (i.e., click) the “Author” table in the Navigation pane & click the Form icon in the Create tab of the Ribbon. b) Modify the form as described below. i. Switch to Design View. ii. Click the “Firstname” textbox and drag it above the “Lastname” text box. iii. After clicking the “Firstname” textbox, click the group selector to select all the stacked controls.

Upload: others

Post on 31-Dec-2020

6 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Database Design Lab: MS Access Formswidit.knu.ac.kr/~kiyang/teaching/DB/s17/labs/lab6.pdfDatabase Design Lab: MS Access Forms 1. Download “lab5.accdb” and rename it to “lab6.accdb”

Database Design Lab: MS Access Forms

1. Download “lab5.accdb” and rename it to “lab6.accdb”.

2. View the Relationship (Database Tools tab) to get an overview of the data model.

3. Create a data entry form for the “Author” table.

a) Select (i.e., click) the “Author” table in the Navigation pane & click the Form icon in the Create tab of the Ribbon.

b) Modify the form as described below.

i. Switch to Design View.

ii. Click the “Firstname” textbox and drag it above the “Lastname” text box.

iii. After clicking the “Firstname” textbox, click the group selector to select all the stacked controls.

Page 2: Database Design Lab: MS Access Formswidit.knu.ac.kr/~kiyang/teaching/DB/s17/labs/lab6.pdfDatabase Design Lab: MS Access Forms 1. Download “lab5.accdb” and rename it to “lab6.accdb”

iv. Select (i.e. click) “Remove Layout” in the Arrange tab of the Ribbon to remove the Stacked layout.

v. Delete the “Author_ID” label and Drag the Author_ID textbox to the Form Header.

Resize Author label

in the Form Header

Click & delete

Author_ID label

Resize the

Author_ID text box

Drag Author_ID to

the Form Header

Page 3: Database Design Lab: MS Access Formswidit.knu.ac.kr/~kiyang/teaching/DB/s17/labs/lab6.pdfDatabase Design Lab: MS Access Forms 1. Download “lab5.accdb” and rename it to “lab6.accdb”

vi. Rearrange the layout of controls as shown below.

vii. In Design View, click the “Form Selector” to select the entire form and set the Record Selector property (Format tab of Property Sheet) to “No”.

Page 4: Database Design Lab: MS Access Formswidit.knu.ac.kr/~kiyang/teaching/DB/s17/labs/lab6.pdfDatabase Design Lab: MS Access Forms 1. Download “lab5.accdb” and rename it to “lab6.accdb”

viii. Add a “Find Record” command button to Form Header.

①. Click the Button control icon in the Design tab and draw a square in the form header section.

②. Select Record Navigation category and Find Record action & click Next.

③. Select Binoculars (Find) picture & click Next

④. Type “btnFind” in the button name box & click Finish.

ix. Add an “Add New Record” command button to form header.

①. Click the Button control icon in the Design tab and draw a square in the form header section.

②. Select Record Operations category and Add New Record action & click Next.

③. Select Go To New picture & click Next.

④. Type “btnAdd” in the button name box & click Finish.

⑤. Change the following properties of the btnAdd command button.

Caption &Add Record

Picture Caption Arrangement General

Back Style Transparent

Page 5: Database Design Lab: MS Access Formswidit.knu.ac.kr/~kiyang/teaching/DB/s17/labs/lab6.pdfDatabase Design Lab: MS Access Forms 1. Download “lab5.accdb” and rename it to “lab6.accdb”

x. Add a “Save Record” command button to Form Header. -- Similar to “Add New Record” button creation (Action = Save Record)

Page 6: Database Design Lab: MS Access Formswidit.knu.ac.kr/~kiyang/teaching/DB/s17/labs/lab6.pdfDatabase Design Lab: MS Access Forms 1. Download “lab5.accdb” and rename it to “lab6.accdb”

xi. Add a “Close Form” command button to form header.

①. Click the Button control icon in the Design tab and draw a square in the form header section.

②. Select Form Operations category and Close Form action & click Next.

③. Select Exit Doorway picture & click Next.

④. Type “btnClose” in the button name box & click Finish.

xii. View the form in Form View & save the form as “frmAuthor”.

4. Create a Split Form for the Book table. a) Select (i.e., click) the “Book” table in the Navigation pane & click the Split Form icon in the Create

tab of the Ribbon. b) Modify the form layout as desired.

Page 7: Database Design Lab: MS Access Formswidit.knu.ac.kr/~kiyang/teaching/DB/s17/labs/lab6.pdfDatabase Design Lab: MS Access Forms 1. Download “lab5.accdb” and rename it to “lab6.accdb”

c) Close the form after saving it as “frmBook".

5. Create a Multiple Items Form for the Publisher table.

a) Select (i.e., click) the “Publisher” table in the Navigation pane & click the Multiple Items Form icon in the Create tab of the Ribbon.

b) Modify the form layout as desired.

c) Copy the Command buttons from frmAuthor.

d) Close the form after saving it as “frmPublisher".

6. Create a navigation menu

Page 8: Database Design Lab: MS Access Formswidit.knu.ac.kr/~kiyang/teaching/DB/s17/labs/lab6.pdfDatabase Design Lab: MS Access Forms 1. Download “lab5.accdb” and rename it to “lab6.accdb”

a) Click the Form Design icon in the Create tab of the Ribbon

b) Click the “Tab Control” icon in the Design tab and draw a large box on the form.

c) Click the Page1 tab, click Other tab of Property Sheet & change the Name property value to “Data

Entry”.

d) Click the Command button in the Design tab and draw a box in the Data Entry tab.

e) Select Form Operations & Open Form and click Next.

f) Select frmAuthor and click Next.

g) Select “Open the form and show all the records” and click Next.

Page 9: Database Design Lab: MS Access Formswidit.knu.ac.kr/~kiyang/teaching/DB/s17/labs/lab6.pdfDatabase Design Lab: MS Access Forms 1. Download “lab5.accdb” and rename it to “lab6.accdb”

h) Select “Text”, type “Edit Author Information” & click Finish.

Page 10: Database Design Lab: MS Access Formswidit.knu.ac.kr/~kiyang/teaching/DB/s17/labs/lab6.pdfDatabase Design Lab: MS Access Forms 1. Download “lab5.accdb” and rename it to “lab6.accdb”

i) Make buttons for “Edit Book Information” & “Edit Publisher Information” in a similar fashion.

j) Add the Exit Application button. -- Category = Application, Action = Quit Application

k) Change the Page2 tab to “Search”.

l) Set Record Selectors & Navigation Buttons properties to “No”.

m) Save the form as “frmNavigation”.

Sample Lab Solution: Download “lab6.accdb”.