Bob,
I think I've solved it - just added at messagebox, 'Save changes?' Yes No (if there are any) in the forms Deactivate method. It's not as elegant as I'd hoped for, since the form being activated is on top, but it seems to work. Maybe I should try to put it in the LostFocus method instead.
Anyway thanks for all your help.
>>The form is being edited, data are not yet commited or reverted, the user clicks on some other open form and all hell breaks loose.
>>
>>I assume the last code to fire on the edited form would be the deactivate method? Could the activation of the other form be stopped here if there are uncommited changes, and if so, how?
>>
>>TIA
>>
>>Peter
>
>I just reread your question. Did you try NODEFAULT in the forms lostfocus or deactivate event? One of those should stop the default behavior from occuring.
>
>BOb
Peter Pirker
Whosoever shall not fall by the sword or by famine, shall fall by pestilence, so why bother shaving?
(Woody Allen)