ok, mira sos super, muchas gracias por tu ayuda, pero no tuve exito, asi que te paso mi codigo original y decime como lo arreglo porfis:
Código Delphi
[-]
procedure tftarea.agregartarea;
begin
buscarOperador;
dm.Qtareas.Close;
dm.Qtareas.SQL.Clear;
dm.Qtareas.SQL.Add('INSERT INTO tarea (fecha, hora, asunto, comentario, id_operador,');
dm.Qtareas.SQL.Add('HoraAReal, FechaAReal, estado, bandera) values (:fech, :hor, :asu, :com, :id,');
dm.Qtareas.SQL.Add(' :hora, :fecha, :est, :band)');
dm.Qtareas.Parameters.ParamByName('fech').Value:= strtodate(lfecha.Caption);
dm.Qtareas.Parameters.ParamByName('hor').Value:= lhora.Caption;
dm.Qtareas.Parameters.ParamByName('asu').Value:= cbasunto.Text;
dm.Qtareas.Parameters.ParamByName('com').Value:= Mcom.Text;
dm.Qtareas.Parameters.ParamByName('id').Value:= strtoint(dbgrid1.Fields[0].Value);
dm.Qtareas.Parameters.ParamByName('hora').Value:= timetostr(dtphora.DateTime);
dm.Qtareas.Parameters.ParamByName('fecha').Value:= dtpfecha.DateTime;
dm.Qtareas.Parameters.ParamByName('est').Value:= 'Pendiente';
dm.Qtareas.Parameters.ParamByName('band').Value:= 'n';
dm.Qtareas.ExecSQL;
end;
donde buscaroperador es:
Código Delphi
[-]
procedure tftarea.buscarOperador;
begin
dm.Qoperador.Close
dm.Qoperador.SQL.Clear;
dm.Qoperador.SQL.Add('select id from operador where nombre = :nom');
dm.Qoperador.Parameters.ParamByName('nom').Value:= cbop.Text ;
dm.Qoperador.Open;
end;