|
Using Combo Boxes in a Form
From NeoWiki
Forms can include Combo Boxes and/or List Boxes to make data entry easier. List Boxes force the user to choose one of a list of pre-defined values. New values cannot be added. List Boxes use references. Combo Boxes do not use references, and allow users to choose from a pre-defined list or to add a new value. For more information on the differences between these two, type Combo Box/List Box Wizard into the Search Term field in the NeoOffice Help window.
For our example, we will create a combo box for the Terrain Type field the the Locations Data Entry form. (see Creating a Simple Data Entry Form) We want to use a combo box here so that we can add new terrain types directly from the Locations Data Entry form, rather than needing to open the Terrain Types table.
Preparing the Form for the Combo Box
These steps are only necessary for forms created using the Form Wizard. If you are creating a form in design view, skip directly to Using Combo Boxes in a Form#Creating the Combo Box
- Open the database document
- Click on the Forms icon in the left column
- Right-click on the Locations Data Entry icon in the Forms section and choose Edit from the contextual menu that appears.
- Click on Terrain Type.
- The Label and the (blank) text box have been grouped in order to proceed, they must be ungrouped: Under the Format Menu, choose {{Menu|Group}]}and then Ungroup.
- Click elsewhere on the form
- Click on the blank text box under the words Terrain Type
- Hit the delete key
Adding the Combo Box
- Make sure the Form Controls toolbar is visible. If not, under the View choose Toolbars and then Form Controls.
- Click on the Combo box icon. (The icon with a blank drop-down box and a scrolling list below it. Watch the tooltips as you mouse over the icons to find the right one.)
- Move your mouse back onto the form. The cursor has turned into cross.
- Drag to create the combo box in the location where the blank text box was before.
- -->A combo box control appears, and the Combo Box Wizard appears
- In the list of tables, click on Terrain Types.
- Click Next>>
- In the Existing Fields section, click on Terrain
- Click Next>>
- Select Yes, I want to save it in the following field:
- Select TerrainType from the drop-down menu
- Click Finish
Notes
- During data entry, if you enter a value not in the combo box, it will be written to the Locations table, but not to the Terrain Type table. For consistancy's sake, it is best to enter Terrain Types in the Terrain Types table as much as possible.
- This process needs to be repeated for any fields for which there exist "convenience" tables. (e.g. StateOrProvince, WaterType, etc.)
- Some individuals may find it easier to create the form using Design View, rather than the Form Wizard, since adding combo boxes requires ungrouping and deleting fields if the Form Wizard has been used.