Ver Mensaje Individual
  #1  
Antiguo 02-12-2007
Camilo Camilo is offline
Miembro
 
Registrado: jun 2007
Posts: 147
Reputación: 17
Camilo Va por buen camino
Consecutivo con While

Hola Amigos Siempre es un placer repasar sus conocimientos y aportes.

Espero su ayuda de ser posible claro esta en el siguiente tema:

Tengo una tabla con un campo llamado Consignacion_No el cual necesito rellenar mensualmente con un numero consecutivo.
trabajo con Paradox y D-7. El tema es que lo hago d la siguiente manera y no interrumpo el ciclo. En todo caso no se si funciona; alguna ayudita por favor.
Código Delphi [-]
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';
table1.Next;
end;
end;
finally
table1.EnableControls;
end;
end;

Por su ayuda mil y mil gracias.
Responder Con Cita