OK really tearing my hair out - wasted a whole evening on this...
Basically I am trying to trap the user into saving or undo their changes...
I have a top level form with a tree view in it that provides my menu structure and if the data hasn't changed in the form the user can launch another form without the annoying "please close this form" message - I only want to trap them if they made changes...
local lnAnswer, strControl, loControl
if thisform.mDataChanged()
lnAnswer = messagebox(' Please Save or Undo changes before launching another screen... ', ;
0 + 64 + 0, 'System Message')
return
endif
That works OK once! If the user exits the form stays open but if they click the treeview again the form closes and the changes are lost...
Putting in the focus to the last control causes the lost focus to fire twice and even then if the treeview is clicked the form shuts down just the same - changes lost...
Please if you have any ideas...