Hola.
Por lo que te entendí podrías hacer:
Código Delphi
[-]
procedure TFr_Venta.InsertOrUpdate(const Producto: string);
var
found: Boolean;
i : Integer;
begin
i := 0;
found := False;
while (i < ReporteVenta.Items.Count) and not found do
begin
found := ReporteVenta.Items[i].Caption = Producto;
Inc(i);
end;
if not Found then begin
T_vta.Insert;
T_vta.Fields[0].Value := producto;
T_vta.Fields[1].Value := precioVta;
T_vta.Fields[2].Value := cantidad;
...
T_vta.Post;
end
else begin
T_vta.Locate(T_vta.Fields[0].FieldName, producto,[]);
T_vta.Edit;
T_vta.Fields[1].Value := precioVta;
T_vta.Fields[2].Value := cantidad;
...
T_vta.Post;
end;
...
end;
Saludos