LookUp Fields in Lazarus lazarus / 16-Databases ---------------------------------------------------------------------- sorinr · 2011-02-27 18:17 Hello Everybody, I'm trying to discover the "secrets" of the lookup fields in Lazarus but I'm still in deep dark. Let me explain: 1. I'm using Lazarus  0.9.28 on a win32 machine along with a Firebird 2.1.3 server and Zeos libraries for connecting and data management; 2. I have on my form a zconnection and two ztables components; 3. The ZConnection is opening my connection to the Firebird database and the two Ztables are getting data from two tables like "Customer" and "Country". Both tables have a common field "Country". Question: How can I set the "Country" field of the "Customer" dataset to work as a lookup field getting the "Country" value from the "Country" table and to be shown in a DBGrid as an already populated "pickup list". I know how to define the column in the dbgrid to be a pickup list and how to populate the list programaticaly, but I'd like to know if it is possible to have it done in the dataset and the dbgrid to see it "auto" as a pickup list populated by the dataset field. It is quite a story but I wanted to give you as much info as possible. Thanks in advance. Sorin ---------------------------------------------------------------------- mecure · 2011-03-08 03:07 I have the same problem. In Delphi is easy to create a lookup field type in a DBGrid component, but I could not do it in Lazarus. I have Lazarus 0.9.28.2 and SQLite. I looked for examples with Google but have not found any that show how to make a lookup field. If anyone has an example lookup field and DBGrid thank you show me the code. Thanks, Mecure ---------------------------------------------------------------------- Old Dog · 2011-03-08 23:31 Are you trying to select a country from a list (generated from a database of countries) and have it in another column generate a list of customers (from a database of customers) in that country? or Are you trying to select a customer (generated from a database of customers) and have it generate a list of data (from a database of countries) about the country the chosen customer is in?