How code tables are implemented

You can define a code table as a property of the following column edit styles:

The steps to specify the code table property for each edit style are similar: you begin by defining a new edit style in the Database painter. Once you select an edit style, use the specific procedure that follows to define the code table property.

For how to create an edit style, see “About edit styles”.

NoteAllowing null values An internal DataWindow Designer code, NULL!, indicates null values are allowed. To use this code, specify NULL! as the data value, then specify a display format for nulls for the column.

StepsTo define a code table as a property of the Edit edit style:

  1. Set the CodeTable property to true.

  2. Click the browse button next to the Values property and enter the display and data values for the code table.

  3. If you want to restrict input in the column to values in the code table, set the ValidateCode property to true.

    For more information, see “Validating user input”.

StepsTo define a code table as a property of the DropDownListBox edit style:

  1. Click the browse button next to the Values property and enter the display and data values for the code table.

  2. If you want to restrict input in the column to values in the code table, set the AllowEdit property to false.

    For more information, see “Validating user input”.

StepsTo define a code table as a property of the RadioButtons edit style:

  1. Click the browse button next to the Values property and enter the display and data values for the code table.

StepsTo define a code table as a property of the DropDownDataWindow edit style:

  1. Click the browse button next to the DDDW_Name property and select the DataWindow object that contains the data for the column from the list.

  2. In the Display Column property value, select the column containing the values that will display in the DataWindow object (in the example, dept_name).

  3. In the Data Column property value, select the column containing the values that will be stored in the database (in the example, dept_id).

  4. Specify the column that provides the display values in the Display Column box.

  5. Specify the column that provides the data values in the Data Column box.

  6. If you want to restrict input in the column to values in the code table, set the AllowEdit property to false.

StepsTo define a code table as a property of the EditMask edit style:

  1. Set the SpinControl property to true.

  2. Set the CodeTable property to true.

  3. Click the browse button next to the Values property and enter the display and data values for the code table.