Ver Mensaje Individual
  #5  
Antiguo 01-08-2013
Avatar de kurono
[kurono] kurono is offline
Miembro Premium
 
Registrado: jul 2007
Ubicación: Republica Dominicana
Posts: 1.126
Reputación: 18
kurono Va por buen camino
tengo el siguiente codigo en el evento OnPresskey del combobox

Código Delphi [-]
var
  S1:string;
begin
  s1:=ComboBox1.Text;
  if Length(S1) >0 then
  begin
    Frm_DM.CS_BA.Close;
    Frm_DM.CS_BA.SQL.Clear;
    Frm_DM.CS_BA.SQL.Add('SELECT Orden,Articulos,Descripcion,Unidad,Cantidad,FechaInicio FROM ARTICULOS');
    Frm_DM.CS_BA.Sql.Add('WHERE ARTICULOS Like'+QuotedStr(combobox1.Text+'%'));
    Frm_DM.CS_BA.Open;

    while not Frm_DM.CS_BA.Eof do  //mientras haya registros
    begin
      ComboBox1.Items.Add(Frm_DM.CS_BA.FieldbyName('Articulos').AsString);  // agregar valor del campo al combo
      Frm_DM.CS_BA.Next;  // siguiente registro
    end;
      Frm_DM.CS_BA.First;
   end
   else
    if Length(S1)=0 then
       ComboBox1.Items.Clear;
       ComboBox1.SetFocus;

no se si este sera el problema
Responder Con Cita