Ver Mensaje Individual
  #3  
Antiguo 26-08-2006
Avatar de Lepe
[Lepe] Lepe is offline
Miembro Premium
 
Registrado: may 2003
Posts: 7.424
Reputación: 29
Lepe Va por buen camino
Dicho de otra forma:
Código Delphi [-]
procedure Tform1.Combo1KeyUp(var key:word....);
var q:Tquery;
begin

  if key = vk_return then // si pulsa intro chequeamos si existe
   if combo1.items.indexof(combo1.text)  = -1 then // no existe
   begin
      q := Tquery.Create(nil);
     try 
      q.DatabaseName := como se llame...
      q.Database := MiDatabase;
      q.sql.text := ' insert into mitabla (Ciudad) values ('+ quotedstr(combo1.text)+ ');';
      q.ExecSql; // elemento añadido a la tabla de ciudades
    finally
       freeandnil(q);
    end;
  end;

Saludos
__________________
Si usted entendió mi comentario, contácteme y gustosamente,
se lo volveré a explicar hasta que no lo entienda, Gracias.
Responder Con Cita