Run Time Error

G

Guest

I have a database that has a button to quit the database. I also have a
button on the menu bar specifically designed for this database which is to
quit the database. About half the time when I use either the button on my
main menu or the button on the menu bar, I'm getting a run time error '2001'.
Any suggestions?

Here's my code for the button.

Private Sub btnQuitDatabase_Click()
'Close File
DoCmd.Quit

End Sub


Thanks for any help you might be able to offer.
 
A

Allen Browne

Before Access can exit, it has to save any edits that are currently in
progress. If you are entering a record that cannot be saved (e.g. a required
field is missing), then the "previous operation" referred to in error 2001
could be the saving of that record.

Try closing any bound forms before you click your quit button. If that
solves the problem, you are on the right track.

We often see people dirtying forms unnecessarily. For example, is you assign
a value to a bound control in Form_Current, then you are dirtying every
record you visit.

If you are making design changes to forms and reports, it is also possible
that these are the "previous operatoin" refers to those changes.

There are other possible causes for the message, if the database is
partially corrupt.
 

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