Lainkes 0 Posted March 18 Hello, I linked some DBCheckboxes to my database. But when I create a new record, all the DBCheckboxes are filled with black. Even if the default value is set on False in the DB. (Using mariiaDB in HeidISQL). So I was wondering how I can uncheck all these DBCheckbox components. I used this code, but it's stays black. // reset all DBCheckboxes for t := 0 to ComponentCount - 1 do if Components[t] is TDBCheckBox then begin // showmessage(Components[t].Name + ' ' + intToStr(t)); (Components[t] As TDBCheckBox).Checked := False; end; When I do a showmessage, the correct names of the components are shown. Thanks for your feedback Alain Share this post Link to post
Uwe Raabe 2064 Posted March 18 As long as you don't change it, any field in a new record is initialized with Null. A TDBCheckBox displays a NULL as grayed - that is what you see. The easiest way to avoid this is to wire the OnNewRecord event of the dataset and initialize the relevant fields with False. Share this post Link to post
Lainkes 0 Posted March 19 (edited) Thanks for your feedback. Greetings Alain Edited March 19 by Lainkes Share this post Link to post