If main form is closed, also quit the application

S

Song

I use Access 2007 default tabbed window. If use right click my main form tab
and select close, I also want to quit the application to prevent other
forms/report still open without main form. (some reports refer controls on
the main form). What's the event to quit? I tried on close and on unload the
form event, I could not quit (action not available when form is closed or
unloaded).
 
B

boblarson

Put this into a new standard module named modClose:

Public Function CloseProgram()
Application.Quit
End Function

And then in the form's Unload event, call

CloseProgram
--
Bob Larson

Free Tutorials and Samples at http://www.btabdevelopment.com

__________________________________
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top