The DropDownDataWindow edit style

Sometimes another data source determines which data is valid for a column.

Consider this situation: the Department table includes two columns, Dept_id and Dept_name, to record your company’s departments. The Employee table records your employees. The Department column in the Employee table can have any of the values in the Dept_id column in the Department table.

As new departments are added to your company, you want the form containing the Employee table to automatically provide the new departments as choices when users enter values in the Department column.

In situations such as these, you can specify the DropDownDataWindow edit style for a column: it is populated from another report. When users go to the column, the contents of the DropDownDataWindow display, showing the latest data:

The sample shows a field labeled Department : with the value Business Services displayed and a down arrow to the right. Below it is a drop down Data Window displaying columns for Name and Code and four rows of data.

StepsTo use the DropDownDataWindow edit style:

  1. Create a report that contains the columns in the detail band whose values you want to use in the column.

    You will often choose at least two columns: one column that contains values that the user sees and another column that contains values to be stored in the database. In the example above, you would create a report containing the dept_id and dept_name columns in the Department table. Assume this report is named d_dddw_dept.

  2. For the column in a second DataWindow getting its data from the d_dddw_dept report, select the DropDownDW edit style.

    In the example, you would specify the DropDownDataWindow edit style for the dept_id column that you want to display with the department name as well as the department ID:

    The sample shows the Edit Style dialog. At the top are fields for Name, shown here as Department List, and Style, shown as Drop Down D W. The remainder of the sample shows an Options area. It has a Data Window box showing d _ d d d w _ d e p t, a Display Column box showing d e p t _ name, and a Data Column box showing d e p t _ i d. A box for Lines in Drop Down shows no value. Width of Drop Down shows 300 %. Limit is 0, Case is Any, and Accelerator is undefined. A box for V Scroll Bar is checked. Many other options are left unchecked.
  3. Click the browse button next to the DataWindow box and select the report that contains the data for the column from the list (in the example, d_dddw_dept). The list includes all the reports in the current library.

  4. In the Display Column box, select the column containing the values that will display in the report or form (in the example, dept_name).

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

  6. Specify other properties for the edit style.

What happens

When you preview a table’s data (or run a form) and data is retrieved, a column with the DropDownDataWindow edit style is populated, providing data to the DropDownDataWindow.

When you run a form, go to the column, and drop it down, the entire report displays. When you select a display value and update the database, the corresponding data value is stored in the database.

NoteLimit on size of data value The data value for a column that uses the DropDownDataWindow edit style is limited to 511 characters.