[Overview][Constants][Types][Classes][Procedures and functions][Index] | Reference for unit 'DBCtrls' (#lcl)

# TDBLookupListBox.KeyValue

Accesses the value for the KeyField in the lookup dataset.

## Declaration

Source position: dbctrls.pp line 493

`public property TDBLookupListBox.KeyValue : Variant read GetKeyValue write SetKeyValue;`

## Description

KeyValue is a Variant property used to access the value for the KeyField in the lookup dataset for the control. It is a Variant type because the KeyField may be represented as any of the valid field types supported in the lookup dataset.

Read and write access to the value is redirected to the internal TDBLookup instance used in the control. Read access uses the value in ItemIndex to call the GetKeyValue method in the lookup component. Write access calls the GetKeyIndex method in the lookup component.

## See also

TDBLookup.KeyField |  | The name of the KeyField used in the lookup search.
TCustomListBox.ItemIndex |  | Ordinal position for the currently selected item, -1 if none.