Stalkium
Stalkium

Reputation: 158

Refreshing a lookup field value after key value change

I have a two tables :

DepName is a lookup value which retrieve DEPARTMENTS.Name using DEPID which references DEPARTMENT.Index.

When using a DBGrid displaying the EMPLOYEES table, and after changing DEPID value, the record's DepName is not updated and do not reflect the change until I re-run the query!

Is there anyway to do this and get the lookup value reflect the change live ?

Upvotes: 0

Views: 1215

Answers (1)

Atreide
Atreide

Reputation: 267

If you can do EMPLOYEES.Post the lookupfield should refresh correctly. In order to keep on Editing the record you can do EMPLOYEES.Edit back again. It is probably not the right way to do it but it did work for me.

You can try CalcField.RefreshLookupList that looks like the accurate way to do it, but it didn't work for me on Delphi XE6 with firedac against Postgres database with cached updates.

Upvotes: 0

Related Questions