If main form is closed, also quit the application

  • Thread starter Thread starter Song
  • Start date Start date
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).
 
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

__________________________________
 
Back
Top