Ordering Lookup Entries

Description

Often you will want to display a list of values selected from a table. It is often desirable to specifically order these entries, instead of allowing them to display in record order or alphabetically. Here is a technique for solving this problem. This example uses a combo box on a form.

  1. Select the control that will display the list, right click, and select Properties... .

  2. On the Setup tab select "Combo Box" in the Field-Type list.

  3. Display the Choices tab.

  4. Select "Computed Automatically" in the Choices for control are list.

  5. Select "Expression (that returns a CR-LF delimited list) in the Source list.

  6. Enter an expression similar to the following in the Expression field.

    table.external_record_content_get("", "", "")
images/UG_Ordered_Lookup_2.gif

In this particular example, the table contains the following values.

Sequence Field
Display Field
"a"

100

"f"

1000

"g"

1250

"h"

1500

"b"

200

"i"

2000

"c"

250

"j"

2500

"d"

500

"e"

750

When the user clicks the combo box, the following list appears.

images/UG_Ordered_Lookup.gif

See Also