LookUpField update lazarus / 16-Databases ---------------------------------------------------------------------- janasoft · 2014-03-09 20:06 I've tried to use a LookUpField and I've get an extrange behavior. When I edit the record in the Grid, when I move the cursor to another field the LookUpField is updated. But if I edit the record using DBEdits, the LookUpField is not updated until the associatte DBEdit get the focus. (it doesn't matter if the DBEdit is ReadOnly or not) I don't want to edit that field but only the KeyField, so I never see the result of the lookup until the record is post. What I would like is that de DBEedit make the things the same way that the Grid I've search in the forum and I've tried to set the property LookUpCache=True but I get the same result. I think this is not the correct behavior or, perhaps, I'm doing something wrong. I attach a hardcopy of the screen and a test program to check. I'm using: Lazarus: 1.0.14 FPC: 2.6.2 W8 - 64 bits (32 bits has the same problem) Firebird 2.5 ---------------------------------------------------------------------- LacaK · 2014-03-13 06:09 What happents, when you remove from qryLU.DataSource  ? (you have set there 'Datasource1') ---------------------------------------------------------------------- janasoft · 2014-03-13 19:46 No change. The Grids reflects the change but DBEdit don't updates its value until it get the focus. Anyway I've checked that If I update the value of MNGR-NO in the DBEdit, the field in the Grid reflects the change but the LookUp Field in the Grid neither reflects the new value. I think there will be some internal mechanism in the Grid which make this task. I've look at the code of the grid but I've haven´t found how it does this. So I´ve make my own mechanism ataching the code: Code: [Select]  dbedit2.Text:= qryLU.Lookup('EMP_NO',DBEdit1.Text,'FULL_NAME') in the OnEditingDone of DBEdit1 In browse mode, the dbedit of the lookup field shows the correct value like it did before. In  editing mode, when I update the value of MNGR_NO, FULL_NAME is also updated, which is what I wanted to get Perhaps it's not elegant, forces to write more code, but it works for me In any case, I would like to know how does the job the DBGrid, but I don´t trust to find out.  Thanks for your help ---------------------------------------------------------------------- LacaK · 2014-03-15 13:37 IMO there is bug , that when value of lookup field changes it does not generates deFieldChange event and TDBEdit is not notified about change. Can you please report it as bug in Mantis bug tracker? ---------------------------------------------------------------------- janasoft · 2014-03-17 20:00 Done ID: 0025876 Thanks for your help LacaK