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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Quit command in Access 97 - no quit!

Status
Not open for further replies.

Cads

Technical User
Jan 17, 2000
40
GB
I'm using the 'Application.Quit' VBA command in Access 97 within a button's click code to enable my users to close the database and leave Access. When I use the button to exit, all is fine. However, when my users do it, Access remains open on the Windows 98 task bar and it's not possible to close Access down with using Ctrl-alt-del.

I've been onto the Microsoft Support site and found a couple of articles. One of which talks about an 'if-then-else' with a check box and another about not closing datasets. Both of these don't apply in my case. I also found an Access 2000 article citing the Windows 2000 DCom config set up but when I run it in Windows 98, once again, the reasoning doesn't apply (or so it seems).

Anyone ever come across this prob? I've even created a one-form, one-button database and this problem still happens for my users. Thanks.

Steve House
shouse@icaew.co.uk
 
Are you quitting from a form/report called from a menu or similar?

Is it possible/practical to use 'docmd.close' instead of 'application.quit', which instead of crashing noisily out of the whole application, will just shut the current form/report?

It might require more clicks (i.e. shut form, then shut main menu for example) but it might solve the problem.

Regarding the original problem, if it works on one machine - it should work on all of them (obvious, of course!). What's different!
 
Maybe it's not how your users are closing Access, but how they are opening it. I have found that when I open Access first, then open a database file from within the Access application. The application is still active when I quit the database. However, if I open the database directly from explorer or a shortcut, then when I quit the database, Access closes also.

Just a thought... ljprodev@yahoo.com
Professional Development
MS Access Applications
 
There is a known bug in DAO that causes a problem like this. If you open DAO objects (such as Database and Recordset) in code, and fail to close them and set them to Nothing before exiting your procedure, Access will minimize instead of closing, and you won't be able to terminate it. (It's waiting for the unreleased objects to be freed, but of course, there's no code running that could do it and no way to get back into Access to run such code.)

However, I'm not convinced this is your problem, since it doesn't occur on your machine. It might still be this, though, if you have SP1 or SP2 installed and your users don't. Rick Sprague
 
I am experiencing a similar problem in Access 97, and I have no solution yet. I want to force the users to quit Access frontend, when I set a shutdown parameter in the database.

I implemented this by keep some form open with a timer, which checks this parameter. If the parameter says "shutdown now", then Access submit the command

"Application.Quit acExit".

Everything works fine, except there is a messagebox open when the command is submitted. In this case, Access minimizes, and can only be closed via task manager.

Here I need a way to work around...

Hayo
 
See my reply to Hayo, but in a nutshell, look for references to user-defined controls that incorrectly use dot instead of bang. This is known to cause this, and can be reproduced easily.
--Jim
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top