Board index » delphi » Urgent! Using the TDBLookupList (Delphi1.0)

Urgent! Using the TDBLookupList (Delphi1.0)

I'm using a DBLookupList to view a field of a table to
give the user a list of names, then I wan't the program
to display the rest of the information in the specified
record, when the user clicks on a name in the list.
Which property do I use in order to store the value of
the selected record in the list, so that the selected
record is displayed after clicking on a name in the list?

Many thanks for all answers.

 

Re:Urgent! Using the TDBLookupList (Delphi1.0)


Quote
On Tue, 30 Jul 1996 09:25:25 +0200, Patrik <se...@algonet.se> wrote:
>I'm using a DBLookupList to view a field of a table to
>give the user a list of names, then I wan't the program
>to display the rest of the information in the specified
>record, when the user clicks on a name in the list.
>Which property do I use in order to store the value of
>the selected record in the list, so that the selected
>record is displayed after clicking on a name in the list?

>Many thanks for all answers.

The DBLookupList will always point to the current record in the TTable
or TQuery that it is attached to.  For example, if you had a Table
called MyCustomerstable and you had a TDBLookupList connected to it,
then when the user clicked on the lookup list you could use the
following code:

        CustomerName := MyCustomerstable.FieldByName('FirstName').AsString;
        CustomerCity := MyCustomerstable.FieldByName('City').AsString;

etc... to get the information you needed.  Or you could simply use
DataAware components and attach them to the same TTable or TQuery as
the DBLookupList and they should be filled in automatically.

Brien King
bk...@primenet.com

Other Threads