Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Force Access to Close All

Status
Not open for further replies.

SmokingCrater

Programmer
Jun 29, 2001
47
US
Does anybody know of a command (VB, Macro, or otherwise) that I can use that will force a close of Access? I need it to force the close through any data objects that may be remaining open. i.e. the force must close any objects as well as the database. I had been using Application.Quit but that does not close any open objects and Access just gets minimized to the taskbar, it does not get closed. The problem I am having is that a hidden object is getting created (I am not creating the object) and therefore Access is not quitting.

I had been using the ExitProcess function found in the Kernel32.dll however the problem with that is the .ldb file is not deleted and my client desires to have that file disappear. Any help would be great.

Thanks.
 
try this code from access web
Dim intx As Integer
Dim intCount As Integer
intCount = forms.Count - 1
For intx = intCount To 0 Step -1
DoCmd.Close acForm, forms(intx).Name
Next
DoCmd.Quit
Cycles through the active forms closing them then closes the application.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top