Hello everyone
I have the following problem
in a DBgrid I have two columns
I want only one of the two columns to be greater than zero, at user input
I did this, but it doesn't work for the last DEBIT field
Do you have an idea ?
if DBGrid1.SelectedField.FieldName = 'CREDIT' then
begin
StatusBar1.SimpleText := 'Champ Credit';
if DBGrid1.Columns[2].Field.Value > 0 Then
begin
DBGrid1.Columns[3].Field.Value := 0; ///////////debit OK this OK the field ZERO
///DBGrid1.DataSource.DataSet.Last();
end;
calcullignes;
end;
if DBGrid1.SelectedField.FieldName = 'DEBIT' then
begin
if DBGrid1.Columns[3].Field.Value > 0 Then //////////champ debit
begin
DBGrid1.Columns[2].Field.Value := 0; ////////credit NOT to ZERO ??
StatusBar1.SimpleText := 'Credit A zero '; ///ok
end;
calcullignes;
end;