Access does not close

G

Guest

I have an Access 97 database that when the database closes it does not close
the instance of Access. To close the database the users either click on an
Exit button that has the exit application function or by clicking the X at
the top of the window.

Any suggestions?

Thanks
 
G

Guest

perhaps the code is creating another instance of Access when it runs.

its generally not a good idea to let a user exit from a form by clicking the
X. I always disable those and provide an exit button.

-Dorian
 
G

Guest

I know how to turn off the X on the form but I do not know how to do it for
the Access Window. Is this possible? If so, what should I do?
 
M

Marshall Barton

dawnecia said:
I have an Access 97 database that when the database closes it does not close
the instance of Access. To close the database the users either click on an
Exit button that has the exit application function or by clicking the X at
the top of the window.


That effect is usually the result of an undestroyed object
in a VBA procedure. E.g.

Set db = CurrentDb()
Set rs = db.OpenRecordset( . . . )
. . .

then not including the following **might** cause the
problem:

rs.Close : Set rs = Nothing
Set db = Nothing

This effect is not limited to just opening a recordset, it
might happen with any object. The general rule is to Close
what you open (and only what you open) and set every object
variable to Nothing when the code is done using it.

Another thing that can cause it is checking an check box
value in an If statement like:
If checkbox Then
This case can be avoided by comparing it explicitly:
If checkbox = True Then
 

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