Rx Database Lookup Combo

RX Library

Control Name Unit Class
TRxDBLookupCombo RxLookup TRxDBLookupCombo

Description:
The TRxDBLookupCombo visual interface component provides your end-users with the ability to select a value for a field from a drop-down list of values that is populated from a second lookup table.

If TRxDBLookupCombo is linked to a lookup field component, it automatically reads the relationship between the field value and the lookup values in the lookup dataset from the field component. The relationship between field values and the corresponding values in the lookup dataset can also be explicitly set using the properties of the lookup combo box when the combo box is not linked toa lookup field component.

This component provides the following:

  • You can select any number of fields to be displayed in the drop-down list.
  • End-users can incrementally search through the lookup list by directly typing into the combo control while the lookup list is displayed. This is a great advantage when using lookup tables that contain hundreds of even thousands of records. You can perform a lookup on a Query or QBE result. It even incrementally searches on the query result.
  • The component does not have to be bound, or assigned, to a table's field (DataField and DataSource properties) which gives you greater flexibility in using this LookupCombo for general tasks where a source table is not involved.

    If DataSource and DataField properties is set, when a user selects a list item, the corresponding field value is changed in the underlying dataset.

If IgnoreCase property is True (default), the incrementally search through the lookup list is processed without regard to case in the dataset's data.

If IndexSwitch property is True (default) and TTable component is linked to the LookupSource, the incrementally search will use available indices of lookup table.

The DisplayEmpty property allows you specify the text value to display when no item is selected from the lookup list. If DisplayEmpty set to the non-empty string, this value will be show in the drop-down list additionaly to the lookup items.

Use DropDownAlign property to specify how the drop-down list is aligned relative to its edit box.

Use an OnGetImage event to specify graphical picture to display in each item of lookup list accordingly to the contents of lookup source.

Write an OnChange event handler to take specific action immediately after the user selects an item from the list and the Value property changed.


Property DisplayEmpty
Declaration: DisplayEmpty: string;

The DisplayEmpty property allows you specify the text value to display when no item is selected from the lookup list and the Value property is equal to the EmptyValue property (empty string by default). If DisplayEmpty set to the non-empty string, this value will be show at the top of the list additionaly to the lookup items. The EmptyItemColor value use to display background of this item.


Property EmptyValue
Declaration: EmptyValue: string;

If database is empty, the variable EmptyValue replaces the table.


Property EscapeClear
Declaration: EscapeClear: Boolean;

When the DisplayEmpty property is set to empty string, the user is not able to clear their selection. The EscapeClear property when set to True (by default), gives the user a convenient way to clear the combos current selection simply by entering the <ESCAPE> character.


Property IgnoreCase
Declaration: IgnoreCase: Boolean;

If IgnoreCase property is True (default), the incrementally search through the lookup list is processed without regard to case in the dataset's data. When False, incremental searching considers case sensitivity when performing an incremental search.

This property has no effect with some SQL-Links.


Property KeyValue
Declaration: KeyValue: Variant;

Use KeyField to determine the value represented by the lookup control (not the value displayed by the lookup control). When KeyValue is set, the lookup control attempts to find a record from the LookupSource's dataset where the value of LookupField matches KeyValue. If such a match is found, the lookup control displays the value of LookupDisplay on that record.


Property ListVisible
Declaration: ListVisible: Boolean;

ListVisible specifies whether the lookup list is open or "dropped-down". Read ListVisible to determine whether the list of lookup values is currently in the open (dropped-down) position. If ListVisible is True, the list is open; if ListVisible is False, the list is closed.


Property Value
Declaration: Value: string;

Run-time only. The value of the Value property is the contents of the DataField for the current record in the primary dataset. As the user moves through the primary dataset, the value of the Value property changes.

By explicitly changing the Value property value at run time, you change the contents of the field.


Event OnCloseUp
Declaration: OnCloseUp: TNotifyEvent;

OnCloseUp occurs immediately after an opened or "dropped-down" list is closed. Write an OnCloseUp event handler to respond when the combo box list is closed. When the list is closed, the value that corresponds to the selected lookup value is assigned to the field. The list can be closed by the user or by calling the CloseUp method.


Method CloseUp
Declaration: procedure CloseUp(Accept: Boolean);

The CloseUp method closes an opened or "dropped-down" database lookup combo box. The Accept parameter determines whether to modify the DataField with the selected value in the combo box.


Method IsDropDown
Declaration: function IsDropDown: Boolean;

IsDropDown method returns True if the lookup list is open or "dropped-down"; if IsDropDown returns False, the list is closed.


Method ResetField
Declaration: procedure ResetField;

ResetField method sets the Value property to the EmptyValue and the DisplayValue to the DisplayEmpty.


Property ClickKey
Declaration: ClickKey: TShortCut;

The ClickKey property determines the key strokes users can use to press a button by keyboard. Default value is "Alt+Down".


Property DirectInput
Declaration: DirectInput: Boolean;

Set this property to True to allow a user to type in a string value into the edit portion. When this property is False, only the button and OnButtonClick can be used to modify the text in the editor.


Index Page | About | Download
Creation Date: 4 Feb 1998 | Last Update: 16 Mar 2000