Adding enumerated field types

You can add your own enumerated field types to a database table. An enumerated field is one that limits the values that can be put into the field to a pre-defined set, these being defined by you. This is useful where a field would naturally contain one of a limited set of values. For example, if you create a patient identification table, and it includes fields for height, weight and eye color, you can make the eye color field an enumerated field and permit only the values blue, green, brown and hazel.

You can also have the enumerated values come from another table see Table lookups.

To create an enumerated field for eye color, do the following:

  1. Type a name for the field in Name, for example, EYECOLOR; set the field type at Enumerated in Type; and click on the Format button to display the "Format Field" dialog (See Creating fields in a database for information on creating table fields).

  2. In the "Format Field" dialog click go to the Format page. In the Values box type the members of the enumerated set: BLUE, GREEN, BROWN, HAZEL. The values should be entered one per line, using Ctrl-Enter on the keyboard to proceed to the next line each time.

  3. Click on OK to save the new information and close the "Format Field" dialog, and click OK again to close the "Format Table" dialog.

  4. The table grid is displayed. Select the EYECOLOR field to display a drop-down menu arrow. When you click on the arrow all the valid values for that field are displayed. These are the only values allowable in this particular column. Click on one of these to insert it into the table cell.

  5. When you are adding records to the table and you type a value into the enumerated field and press Tab to move on, one of three things will happen:

  1. If you have put in one of the acceptable values, Ability will accept it.

  2. If the value you enter is not in the enumerated set, Ability will not accept the value and the cell will remain blank.

  3. If you type the first letter (or several letters) of a valid value, Ability will display the first alphabetical entry from the list that matches this letter (or letters).