
Chapter 7: Databases and Data Sources
Creating a group of option buttons
Option buttons (also known as radio buttons) let users choose one item from among a
mutually exclusive group.
The easiest way to set up a group of option buttons is:
1. Make sure the Wizards On/Off button on the Form Controls toolbar is on.
(When it's on, it has a thin border around it.)
2. Put a group box on the form by click the Group Box button on the More
Controls toolbar and then clicking and dragging in the form. The Group
Element Wizard – Data appears to guide creation of an option group.
3. On the first page, specify the options to appear in the group. For each, type it in, and
then press Enter or click the >> button. When all the items have been entered, click
Next.
4. On the second page, indicate which item in the list should be initially selected. Users
can also specify no item be selected. Click Next.
5. On the third page one can associate a value with each item. Specifying a value is
particularly significant when data on the form is tied to a data source. (See
"Activating form controls in a document" below.) To specify the value for an item,
click that item in the list, and then type the appropriate value in the text box. By
default, character items are associated with numbers starting from 1. Click Next to
move to the Database Field page.
6. The Database Field page lets one automatically save the user's choice to a field in a
table. If preferred, users can specify that the value is available only in the form. Click
Next to reach the final page of the wizard.
7. On this page, one specifies a name for the option group-the name appears as a caption
on the surrounding box. Click Finish to exit the wizard and create the option group.
Do any other controls have an wizard?
Most of the remaining controls are simple enough to configure that no wizard is needed or
provided. However, the Table control is fairly complex. It provides a grid type display of the
data in a table, along with navigation controls. The Table Element wizard lets one choose
which fields display and in what order.
Attaching a data source to a form
Using the wizards for some kinds of controls requires the user to specify a data source for the
form. However, sometimes, one may want to do so even if one is not creating a combo box
or list box.
To link a data source to a form:
1. In the database window, right-click the form and choose Edit to enter Design mode.
2. Click the Form Navigator button on the Form Design toolbar.
OpenOffice.org User Guide for 2.x 385
Comentarios a estos manuales