Adding Controls from the Toolbox
Return to main tutorial page
Return to form creation page
The toolbox offers
a quick means of creating a number of useful controls. These include
drop-down boxes (combo boxes), buttons, list boxes, radio buttons, toggle
switches and others. If the wizard
is enabled, then
the basic procedure is to click on the the control you wish to create on
the toolbox, and drag or click again on the form approximately where you
wish to place the control. We will now examine some examples of control
creation.
Drop-Down (Combo) Boxes
-
To create a drop-down (combo) box, first click on the combo box icon
.
-
Then, click on the form approximately where you wish to place the combo box.
-
If the wizard is enabled, you will be given a choice of options, as shown
in the dialog box shown here.
Figure 1: Choosing the source of combo box values.
At this point you have three options for populating your combo box
with values. First, you can have the combo box run a query when a user
clicks on the combo box. The query will run and populate the combo
box with completely current data. This type of combo box is very helpful
if the values in the combo box are likely to change on a regular basis.
For example, if you had an application in which you had to pick an
employee from the set of all current employees, then such a dynamic combo
box would be appropriate, showing always the current set of employees.
This is most flexible option. Second, you can type in the values
you wish at the time the combo box is created. This option, currently
selected in the figure, is appropriate for cases in which the options do
not change frequently. 'Gender' is a clear example. The third
option will not only allow a user to pick one of the permitted values, but
will then find a record that match the value chose. This provides
a fast 'record lookup' function.
-
In our current example, we choose to type the values in manually. This
option brings up a window in which we are given the opportunity to specify
a) how many columns will be in the combo box, and b) the values we wish to
be in the combo box. Note that even if you specify multiple columns,
only the left-most column will be displayed until the user clicks the combo
box.

Figure 2: Typing in values for the combo box.
-
When we click the Next> button, we are again given a choice.

Figure 3: Choosing to associate the combo box with a table column
(field).
What do we do with the value the user selects? One option is to do
nothing other than store that value to be used later, such as in a query.
The other option, shown selected here, is to store the value in a table
column. If we choose this option we must also select, from the combo
box shown here, the column into which the value is to be stored.
-
Finally, we must provide a label for this combo box when it appears on our
form.

Figure 4: Providing a label for the combo box.
-
The finished combo box appears below.

Figure 5: The finished combo box.
Return to main tutorial page
Return to form creation page