Hello boulenajm
If I understood your question correctly, you don't want to save a field that is empty. That's right ? In this case, here's how I do it:
Prevent a field from being empty
When creating the database, you can create a NOT NULL field to prevent its value from being empty.
You can also use a script behind the OnClick event of the SaveRecord button.
Example:
procedure Form2_Button1_OnClick (Sender: string; var Cancel: boolean);
begin
if (Form2.Edit1.Text = '') or (not Form2.CheckBox1.Checked) or (Form2.ComboBox1.dbItemID = -1) then
begin
ShowMessage ('Please fill in the fields');
Cancel: = True;
end;
end;
Here we take the opportunity to check that a CheckBox is checked.
Hope this can help you
JB