using db controls connected to a FireBird database. and I have a simple dblabel I want to change text color based on current value for current record
The user navigate using the dbnavigator and I wrote code in the navigator button click. but there is a problem the code always read the previous record value not the current one so the color is wrong !! for example:
procedure <navigator button click>;
begin
if table1.FieldByName('field1').AsString = 'val1' then
<dblabel.textcolor> := red
else
<dblabel.textcolor> := green;
end;
but as I said the value is one record behind. why is that and what is the best approach to change label text color ?
Thanks