chapter 10 - advanced forms design

Post on 11-Apr-2015

437 Views

Category:

Documents

0 Downloads

Preview:

Click to see full reader

TRANSCRIPT

10 Create a list of choices

Access 2007 provides two list controls – the list box and the combo box.

List Box: The list box control displays a list of values or choices.

Combo box: The list of combo box is hidden until you click the drop-down arrow.

10.1 Create a list box by using a

wizard

Suppose we have the following data in the Book table

And we want to create a form to list the book name from selecting the book author in the list control.Suppose we have a form like this

Make sure you are in the Design View of the form. The following steps will show you how to create a list box or a combo box.

Here I click the List Box tool as an example. Then click on the form area where you want the List Box / Combo Box to be placed.

1) Ensure the Use Control Wizards is selected

Combo Box

List Box

2) Click either the List Box tool or the Combo Box tool.

A List Box Wizard / Combo Box Wizard is displayed.

3) Choose this

5) Choose BookAuthor 6) Click it

And you will see the BookAuthor appears in the Selected Fields.

7) Next

8) Tick “Hide key column to hide the Primary key

You can see a list control is created in the Design View of the form now.

9) Give a label to the list box

10) Finish

Now open the Book form, you will see the result.Whenever you click the BookAuthor name, the corresponding BookName and BookID will be displayed.

10.2 Create a combo box by using a

wizard

Suppose we have another new form called Book_form2.

1) On the Design tab, in the Controls group, ensure that Use Control Wizards is

selected.

2) Click the Combo Box tool.3) On the form, click where you want to place the combo box.

4) Click this

5) Next

6) Click this

7) Next

8) Tick Hide key column

9) Next

10) Give a label to the combo box

11) Finish

Save it as Book_form2 and open it, you will see a combo box is created.

10.3 Setting Combo Box Properties

Manually

Go to the Design View of Book_form2, right click the Combo Box you have just created and select properties.

1) Select Yes in the Column Heads

2) Change to “7cm” in the List Width

Then save it and open the Book_form2 again. You will see there are column headings above the values and the list width is widened.

10.4 Adding a Subform with the

Wizard

Suppose we have the following relationships.

1) Click Create 2) Click More Forms

3) Click Form Wizard

Select the following fields according to the steps shown below:

1) Next

2) Select by User

3) Select Form with subform(s)

4) Next

5) Select Tabular

6) Next

7) Choose a style you like

8) Next

A Subform is created and you can now check the Borrow record for each User.

9) Enter a name for the main Form

10)Enter a name for the subform

11) Finish

top related