Topic: Restart the form after click on save

Hi,
I need to restart the form (Clear all fields values) after click on save without closing the form to add new record!
how can i do that ?!

Re: Restart the form after click on save

Hello,


In settings of button "Save Record" you should uncheck option "Close the current for after saving",
then create event OnAfterClick:


procedure frmEmployee_Button2_OnAfterClick (Sender: string);
begin
    frmEmployee.edLastName.Clear;
    frmEmployee.edFistName.Clear;
    frmEmployee.dtDateOfBirth.Checked := False;

    Form1.GridEmployees.dbUpdate;
end;   



Also you can download example project:

Post's attachments

Attachment icon Save record and clear.zip 5.18 kb, 534 downloads since 2014-11-17 

Dmitry.

3 (edited by sonixax 2014-11-18 01:42:48)

Re: Restart the form after click on save

Thank you smile and how can I Clear ComboBoxes ?!

Re: Restart the form after click on save

Form1.ComboBox1.dbItemID := -1;
Dmitry.

Re: Restart the form after click on save

Thank you smile