Closing objects before exiting in Access 2000

J

Joy

Hi,
Should objects (particularly a hidden form) be explicitly closed using VBA
code before exiting Access.
A main form has a button with the code "Application.Quit" (without the
quotes). I always thought that when you close the program, all open objects
will automatically close. There is a hidden form that's open at all times.
Should I explicitly close it when the application closes? The OS in Win2000
and users are sometimes getting the error message "The database has been
placed in a state by user "user name" on machine "machine name" that
prevents it from being opened or locked." The knowledge base says this is
related to the service releases but all SRs have been installed.

ANY and ALL help would be appreciated.
Thanks in advance.

Joy
 
A

Allen Browne

Try:
DoCmd.Quit
instead.

Double-check you have JET 4 service pack 8, as well as the Office service
pack. Locate msjet40.dll (typically in windows\system32). It should be
version 4.0.8xxx.0. If you don't see the "8", go to support.microsoft.com,
Downloads section.

It should not be necessary to close each object, but it may depend how they
were opened, and what other objects are instantiated.
 
J

Joy

Allen,
Thanks for answering.
I'll tell the client to check for this. I'll also change the exit code to
reflect what you suggest.
Joy
 

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