Sign in Join
FPDoc Onlineexperiment

TDBLookup.KeyFieldValue function

Member of TDBLookuppublicIn unit DBCtrls

Gets the value(s) for one or more key fields defined for the Field in the linked dataset.

Declaration

pascal
function KeyFieldValue: Variant

Function result

Variant value for the key fields in the field definition for the control.

Description

KeyFieldValue is a Variant function used to get one or more values for fields which make up the index key for the linked dataset in the control. KeyFieldValue uses the internal TFieldDataLink instance in the class to get the return value for the method. The return value contains the content from the FieldValues property for the linked DataSet.

The return value is Null under the following conditions:

  • The internal data link has not been assigned
  • The Dataset in the data link is not Active
  • The Field in the data link does not have defined key field names

KeyFieldValue is useful for getting the index value for the current record in the linked dataset. It is not, however, used in the implementation of the class or descendants.

See also

An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.