Ver Mensaje Individual
  #2  
Antiguo 21-09-2013
isaiaseml isaiaseml is offline
Registrado
NULL
 
Registrado: oct 2012
Posts: 6
Reputación: 0
isaiaseml Va por buen camino
yo lo que hago es en el evento Onchange del incrementalsearch
programo lo siguiente

Código Delphi [-]




var txt, sfind: string;
     len: integer;

  begin
     if edFromCode = true then
        begin
                edFromCode := false;

                 exit;

        end;
       txt:= busca.Text;
       if Length(txt)=0 then
       exit;

     sqlmiqry();


        sfind:=miqry.FieldByName (''+campo+'').AsString;

        len := Length(sfind) - Length(txt);
          if len > 0 then begin

         edFromCode:=true;
   busca.Text:=sfind;
   busca.SelStart:=Length(txt);
   busca.SelLength:=len;

   end;

end;


y en el evento Onkeydown del mismo componente pongo esto

Código Delphi [-]


begin
         if (Key=VK_DELETE) or (Key=VK_BACK) then begin
   if Length(busca.Text)>0 then
   begin
     edFromCode := true;

   end
   else if Length(busca.Text)=0 then
   begin

        sqlmiqry();
     edFromCode := true;
 //     exit;
   end;
 end;
end;


con eso logro que me regrese conforme voy tecleando el evento que mas se le paresca a la consulta que hago a mi qry

la variable edfromcode declarala de tipo booleano ... espero me haya dado a entender.

Última edición por isaiaseml fecha: 21-09-2013 a las 00:50:32. Razón: un error de apreciacion
Responder Con Cita