Ver Mensaje Individual
  #5  
Antiguo 12-07-2006
nemesio nemesio is offline
Miembro
 
Registrado: nov 2005
Ubicación: Isla de Margarita, Venezuela
Posts: 377
Reputación: 21
nemesio Va por buen camino
Es válida cualquiera de las 2 opcíones. Puedes colocarlo en el evento OnKeyPress del Edit, algo asi como:

Código Delphi [-]
procedure TForm1.EditCodClienteKeyPress(Sender: TObject; var Key: Char);
begin  
  if Key=#13 then
  begin
   AdoQueryCliente.Close;     AdoQueryCliente.SQL.Add(' SELECT codcliente, Nombre, Apellido FROM CLIENTES ');   AdoQueryCliente.SQL.Add('WHERE CodCliente: Codigo');   AdoQueryCliente.ParamByname('Codigo').Value:=EditCodCliente.Text;   AdoQueryCliente.Open;     if not AdoqueryCliente.IsEmpty then      LabelCliente.Caption:=AdoQueryClienteNombre.Value+' '+AdoQueryClienteApellido.Value;  end;
end;

o Colocarlo en un en el evento OnClick de un Botón. Todo va a depender de como quieras hacerlo y de lo que requiera tu aplicación.

Última edición por Neftali [Germán.Estévez] fecha: 12-07-2006 a las 09:57:19.
Responder Con Cita