>>Hi everybody,
>>
>>I need to implement the following functionality:
>>
>>Cancel button (and clicking on the Close x button at the top of the form will prompt in case of unsaved changes and let the user to save them or really close/cancel – note, this behavior is non-standard to other application forms where Cancel just cancels without any prompts).
>>>>So, this is the question I added (see attached), but I am not sure I like it. I am wondering how should I phrase this prompt question - can you please suggest?
>>
>>Thanks in advance.
>
>
>LOL! Very funny phrasing. :-)
>
>Most developers use something like "Leave page and lose changes? Yes, No"
I decided to go with Michel's suggestion and currently have this
if vartype(m.tcMode) = 'C' and m.tcMode = 'Close'
lcQuestion = "You have unsaved changes. Do you really want to close this form without saving?"
else
lcQuestion = "You have unsaved changes. Do you really want to cancel them?"
endif
if messagebox(m.lcQuestion,4+32 + 256, 'Cancel Changes') = 7
if not thisform.save()
llReturn = .f.
nodefault
endif
If it's not broken, fix it until it is.
My Blog