Yes, you can trap this situation, but in QueryUnload event. If you want to cancel form unload, set Cancel parameter of this event to True (or something different from 0). In addition, you can use UnloadMode parameter to determine which cause form unloading - clicking of 'X', issuing Unload command from code, etc. Check MSDN article "QueryUnload Event" for further information.
Plamen Ivanov
MCSD .NET Early Achiever and MCAD .NET Charter Member (VB .NET/SQL Server 2000)
MCSD (VB 6.0/SQL Server 2000) br>
VB (.NET) - what other language do you need in the whole Universe?...