It sounds to me that you have a threading-problem, with a thread running when you close the form. This will result in the form disappearing, but another thread keeping the process alive. Try the Closing event for the Form, and make sure you shut down all threads (might be some database-shutdown command or similar to shutdown/disconnect teh database correctly).
Internet - the worlds biggest dictionary