I have an MDI Frame with two MDI Child forms. I have a menu option and a pushbutton that allow the user to 'Close' the frame and child forms. (Then menu item sends a 'CLICK' event to the pushbutton.)
In the 'CLICK' event of the pushbutton I get the SAVEWARN properties for both the child forms (the frame is not databound). If either of the forms has SAVEWARN Eq TRUE$ then I set a flag within the script to true. Then I set the SAVEWARN properties of both forms to FALSE$.
If the flag is true, then the user is prompted to save or not to save. If the response from this message is true, then the forms are saved, but if the response is false, the form closes.
Unfortunately, when the response to the message is not to save, I still get OI's generic save warning message box. If I have set the SAVEWARN properties of both forms to FALSE$, why am I still getting this message?
gjames@cyberhighway.net onmouseover=window.status=email greg james;return(true)"
Greg,
This was a problem that had us going for awhile a couple of years ago. In our situation we finally figured out that this problem only occurred when the cursor was in an editbox control. There is a little known problem (although this is covered in an SENL article somewhere) that the GOTFOCUS_VALUE and the DEFPROP value of an editbox will not match even if there have been no changes. The reason is because GOTFOCUS_VALUE uses the TEXT property which uses CR/LF's and DEFPROP uses the TEXTVAL property which uses @TM's. So if the cursor is floating in an editbox, even after you set SAVEWARN to false, the focus returns to the editbox, GOTFOCUS_VALUE won't match DEFPROP, SAVEWARN gets set to true again, and the generic save warning comes up.
The solution is to have the system move the focus to a non-editbox control before checking the SAVEWARN flag.
dbakke@srpcs.com
Don,
Thanks for the thorough explanation of this problem. I haven't had time to experiment with it yet, but I will be soon. Your help is, as always, appreciated.
gjames@cyberhighway.net onmouseover=window.status=email greg james;return(true)"