Copyright: 0.9 (preview version)


TQILookupDialog component

Enables the user to lookup an existing field value for searching, etc.

A field is selected from list obtained from all fields in TQueryInfo.Fields.Selections (or if no selections made, all in QueryInfo.Fields as default) whose FieldUsage contains the uaLookup and uaSelect attributes using the defined UserName.

On the selection of a field, a query is executed and all distinct values are placed in a list from which the user may select. Incremental searching is provided. The selected field and value are placed in TQueryInfo.Fields.Lookup.

properties

Caption, ModalResult, QueryInfo, MultiColumn, ShowGlyphs, Reset, Exclusive

methods

Execute, FindFirstValue, FindNextValue

files

qiLookup.dcu/dfm	unit & form resource

qiLookup.hlp	hypertext help reference (this file)


Execute method

Shows the dialog modaly. Returns True if OK button pressed (mrOK).

declaration

function Execute: Boolean


FindFirstValue method

Searches from the start of DataSet for the first instance of Value in the field specified by FieldName. Returns True and sets DataSet to the row found in if found, otherwise returns to the original position and shows a message that the value was not found.  Useful for looking up the result of the dialog execution in an ad hoc query (TQuery).

declaration

function FindFirstValue(DataSet: TDBDataSet; FieldName, Value: String): Boolean;


FindNextValue method

Searches from the next position in DataSet for the next instance of Value in the field specified by FieldName. Returns True and sets DataSet to the row found in if found, otherwise returns to the original position and gives message that no more instances of Value were found. Useful for looking up the next instance of the result of the dialog execution in an ad hoc query (TQuery).

declaration

function FindNextValue(DataSet: TDBDataSet; FieldName, Value: String): Boolean;


Caption property

Appears as the dialog’s caption.

type

string

stage

design time 	run time

access

read 	write


ShowGlyphs property

Specifies if Borland-style bitmaps are shown on the dialog buttons.

type

Boolean

stage

design time 	run time

access

read 	write


QueryInfo property

References the TQueryInfo component to use on execution (must be assigned before Execute is called).

type

TQueryInfo

stage

design time 	run time

access

read 	write


MultiColumn property

Specifies whether looked up values are to be displayed in multiple columns. The number of columns is determined by the DisplayWidth of the field.

type

Boolean

stage

design time 	run time

access

read 	write


ModalResult property

Stores the modal result of the dialog Execute call.

type

TModalResult

stage

run time only

access

read only


Exclusive property

If set, then only the field in QueryInfo.Fields.Lookup.Field can be looked-up on.

type

Boolean

stage

design time	run time

access

read	write


Reset property

If set, then the dialog controls are reset, ie. no field or values appear, otherwise the previous lookup is initially set. Default: True.

type

Boolean

stage

design time	run time

access

read	write