program doesnt exit correctly

i have a form that loads.  User enters ID and pass.  If the password is correct for that ID then it loads a MDI form and other child form open up after that.  well, if the user closes the program with the X in the top right the program is still running in the process list.  But if they close it with my close button, it exits like it should.

I have a datbase connection, is that what might be keeping my program running?  is there a way i can execute commands then the user closes with the X?
Who is Participating?
SpideyModConnect With a Mentor Commented:
PAQ'd and points refunded.  

Community Support Moderator @Experts Exchange
kmorris1186Author Commented:
I just found it after i posted this question..

in the mdiform_unload

close the DE connection
then end..

can i remove this question??
Open your form then go to the code window select form on the right dropdown then unload on the left dropdown then close youdata connection.
All Courses

From novice to tech pro — start learning today.