procedure TForm1.Button2Click(Sender: TObject);
var
Consecutivo: Integer;
begin
Consecutivo := 0;
Consecutivo := Consecutivo + table1['Consignacion_No'];
table1.First;
try
table1.DisableControls;
while not table1.EOF do
begin
if table1['Consignacion_No'] = '0' then
begin
table1.Edit;
table1.Fieldbyname('Consignacion_No').AsString := 'Consecutivo';
end;
table1.Next;
end;
finally
table1.EnableControls;
end;
end;