[SOLVED] Why is DBMemo hanging up after ApplyUpdates? lazarus / 16-Databases ---------------------------------------------------------------------- guest48180 · 2018-07-01 03:52 When I double-click the DBMemo to edit, it hangs up and won't do anything until I click back into it again. The behavior's strange. Here are the project files. Run it and click the cupcake (seriously ), then doubleclick the DBMemo on far right. Whether you cancel the edit or update it, it still locks up. And I can't figure out why that's happening. A little insight here wld be appreciated. The code in recipe_name_grid.pas that opens the edit: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i procedure TRecipes.DBMemo1DblClick(Sender: TObject);var  Frm : Tfrm_edit_memo;begin  Frm := Tfrm_edit_memo.Create(Nil);  try     Frm.fID := Query3.FieldByName('name_id').AsInteger;     Frm.ShowModal;   finally     Frm.Free;     Query3.ApplyUpdates;     Query1.Refresh; // initially used Query3 here. Then tried Query2. Just trying with zero success.   end;end; and the edit_memo.pas code: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i procedure Tfrm_edit_memo.btnUpdateClick(Sender: TObject);begin  SQLQuery1.SQL.Text:='UPDATE recipe_notes SET note = :note WHERE name_id = :id';  SQLQuery1.ParamByName('note').AsString:=DBMemo1.Text;  SQLQuery1.ParamByName('id').AsInteger:=fID;  SQLQuery1.ExecSQL;  DataMod.SQLTransaction1.CommitRetaining;  SQLQuery1.Active:=False;  // recently added with no affect  Close;end; Thanks ---------------------------------------------------------------------- mangakissa · 2018-07-02 06:51 Why are you using a DBMemo if you writing the text directly to your table? DBMemo is connected to your dataset, so any changes (when DBMemo is modified) are saved to your tabel when you call 'post'. In other case don't use DBMemo but memo. Why are you creating a DBMemo at runtime when you have a form at desingtime? ---------------------------------------------------------------------- guest48180 · 2018-07-02 15:34 Quote from: mangakissa on July 02, 2018, 08:51:36 amWhy are you using a DBMemo if you writing the text directly to your table?For the same reason you're using DBAware components on your FrmAuthorEdit in your sqldb project. I'm just mimicking what you did. Quote from: mangakissaDBMemo is connected to your dataset, so any changes (when DBMemo is modified) are saved to your tabel when you call 'post'. In other case don't use DBMemo but memo. Noted. Quote from: mangakissaWhy are you creating a DBMemo at runtime when you have a form at desingtime? Yeah, I'm really lost on all of this. Thing is, I was copying you. But it seems I did a few things you didn't do. I mean, you created forms at runtime, forms you had completed at design time. But I guess I did something wrong there. Please refer to sqldb project you sent me to understand why I did this. Some people are better with this than others. Like you, mangakissa...you're better at it than I am. That doesn't mean I'm not trying. I'm just not grasping some things as well as you. Anyway, thank you for your help. ---------------------------------------------------------------------- mangakissa · 2018-07-03 06:57 QuoteSome people are better with this than others. Like you, mangakissa...you're better at it than I am. That doesn't mean I'm not trying. I'm just not grasping some things as well as you. Anyway, thank you for your help.I'm just an average  developer with a lot of years working with Pascal OOP progamming. I'm glad that you try it yourself and we on this forum are helping you as much as we can. As you already said my forms are loaded @rumtime which already designed. As you also can see that the form is not connected the the table of the previous form. It has his own connection to a dataset. That's why it can work independent. In your case (when you want to start a memo for the description) my above answer is the quickiest way. You don't want to see my first program written in Delphi ---------------------------------------------------------------------- guest48180 · 2018-07-03 11:17 Thanks, mangakissa. I followed what you said and fixed it right away.