Saving hidden data-ish lazarus / 16-Databases ---------------------------------------------------------------------- Glewins · 2018-02-03 21:48 I have 2 groups using a single pick list.  I want one group to see only their own data.  Human resources and First Aid will be using the tablr. Example: Table = Gender Field1 = Gendername varchar(30) Field2 - Gendercode varchar(1) When a First aider opens the form, the sql is like -> select x from gender where gendercode='F' order by Gendername.  This all works. When a Human Resources opens the form, the sql is like -> select x from gender where gendercode='H' order by Gendername.  This all works. On the form, I leave a dbedit invisible, once the user adds a gender, on the exit, I add the corresponding 'H' or 'F', then do a post. Commit; The Gendername is saved but the gendercode is not. Any ideas? George Lewins ---------------------------------------------------------------------- valdir.marcos · 2018-02-04 03:54 Please, show some code. Maybe, you missed something on your SQL text. For example, you might think you are saving both fields, but your SQL text might be such as: Code: [Select]Update Gender Set Field1 = :Gendername; ---------------------------------------------------------------------- rvk · 2018-02-04 12:35 Quote from: Glewins on February 03, 2018, 10:48:35 pmOn the form, I leave a dbedit invisible, once the user adds a gender, on the exit, I add the corresponding 'H' or 'F', then do a post. Commit; Instead of an hidden TDBEdit you can also just set the value directly. 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 SQLQuery.FieldByName('gendercode').asString := 'F'; // or 'H'SQLQuery.Post;SQLQuery.Commit;You don't need a TDBEdit for that (especially if you don't show it anyway). You do need to have the gendercode in your SELECT.