Topic: After saving to clear the form?

in "Action for the button" option "Save Record" there is the "Close the current form after saving", how to proceed after saving to clear the form to use again?

2 (edited by tcoton 2016-03-08 10:38:10)

Re: After saving to clear the form?

You would have to use scripts to clear your fields and comboboxes with an event OnAfterClick on your save button.

procedure Form_Button_save_OnAfterClick (Sender: string);

  begin
     form.field1.Clear;
     form.field2.Clear;
     form.combobox1.dbItemID := -1; ; 
     form.combobox2.dbItemID := -1; 
   end;

Re: After saving to clear the form?

Please have a sample file?

Re: After saving to clear the form?

Hello Gilberto_Schiavinatto

Something like this ?

JB

Post's attachments

Attachment icon toto.zip 334.05 kb, 490 downloads since 2016-03-08 

5 (edited by Gilberto_Schiavinatto 2016-03-09 01:13:45)

Re: After saving to clear the form?

Ok jean.brezhoneg / tcoton , thanks.



Hi administrators that the possibility of including this option in "Action for the button"

Re: After saving to clear the form?

Hello Gilberto, Jean, Thierry,

As Gilberto suggests, a button action to SAVE but also stay on the form and clear all fields ready for the next record to be entered would by useful.
I currently clear my forms in the same way as suggested by Thierry and Jean.
What I also do by script is, after having cleared the fields, add the option to 'repeat' the previous field value by using a reserved character (the '=' is an obvious choice but anything can be used).  Why?  Using Jean's example, you may have 10 different books by the same author so you don't want to retype the author every time.
I also change the field label after the first 'SAVE' to remind the User of this option (I have some  very forgetful users!).
I have used Jean's example (thanks, Jean) to show how I do this.
Hope it helps.
Derek.

Post's attachments

Attachment icon toto2.zip 337.04 kb, 513 downloads since 2016-03-09 

Re: After saving to clear the form?

Hello Gilberto and Derek

To answer Gilbrto's wish having possibility to aswer by Yes or No for a new entry,
here is my script to do that.
From Derek's proposal to use same author when entering many books from one author,  I use a comboBox

It's true Dmitry could embed this fonction Yes or No directly into MVD

JB

Post's attachments

Attachment icon BOOKS.zip 335.08 kb, 463 downloads since 2016-03-13