Topic: Clicking a Save Record button exits the program

As the topic subject says, when I click a button whose action is to Save Record, it saves the record  and then closes the program down.  I don't have any events attached to this button, and can't for the life of me work out why it is doing this.

I've attached the program if anyone is able to help.  The problem button is the 'add order' button on the Create Order tab.

Post's attachments

Attachment icon partsrequest.zip 348.85 kb, 316 downloads since 2020-02-09 

On a clear disk you can seek forever

2 (edited by sibprogsistem 2020-02-09 10:43:36)

Re: Clicking a Save Record button exits the program

http://myvisualdatabase.com/forum/misc.php?action=pun_attachment&item=6229&download=0

Post's attachments

Attachment icon Безымянный.png 125.17 kb, 118 downloads since 2020-02-09 

3 (edited by derek 2020-02-09 10:53:17)

Re: Clicking a Save Record button exits the program

Hi CDB, Hi Sibprogsistem,
As Sibprogsistem has shown, you need to remove the tick in the 'Close the Current Form after Saving' option associated with your 'save' button.
You wouldn't normally have to do this but in your example, you are not using a separate form to create an order, you are using a 'tabsheet' within a 'pagecontrol' - but it is all the same form (frmmain) so when you were saving the record, that was the form that was getting closed.
My suggestion would be, once you've clicked the 'save' button, is to return to the 'orders' tabsheet and refresh the orders tablegrid so the user can see that the order has been added correctly (have a look at the script where I've added a couple of lines to do this).
Regards,
Derek.

Post's attachments

Attachment icon cdb partsrequest.zip 350.57 kb, 296 downloads since 2020-02-09 

Re: Clicking a Save Record button exits the program

Thank you sibprogsistem and Derek,

I completely overlooked the 'Close form ' option in the action dialogue. I must have ticked that when I was going to have an extra form pop up and then send an email with the order details.

Most grateful for your assistance.

On a clear disk you can seek forever