Topic: Warning message on Cancel

I'm almost certain this has been asked before. I was looking for a script that shows a warning message when cancel button clicked while adding / editing a record but couldn't find.



During adding / editing; if any field of the record changed and user clicks cancel button with an action to close form, app shows warning message something like "Are you sure you want to disregard changes?" Clicking No on warning dialog takes user back to the form he was working with and clicking Yes would close the form without saving changes.

Adam
God... please help me become the person my dog thinks I am.

Re: Warning message on Cancel

Adam, See if the attached is what you are looking for. The method to my madness is to load all the fields on a form into one string. I created a function to do this. You then call this function at the On_Show event of any form and hold the result into the Start_Data string varialble. You then call the function again on the On_Click event of the Cancel button and hold the data in the End_Data string. You just compare the two strings on the Cancel button event and produce a message if they do not compare equally.


This method will not handle images stored in the database. You will need to handle images separately by holding the image at the start of the form and then check it when you click the Cancel button.

Post's attachments

Attachment icon Check For Changes.zip 584.79 kb, 503 downloads since 2017-03-06 

Re: Warning message on Cancel

Hi EHW,


Thank you very much..............................
Appreciated.....

Adam
God... please help me become the person my dog thinks I am.