Exiting Access Problem

  • Thread starter Thread starter Don Stone
  • Start date Start date
D

Don Stone

Greetings--

I am experiencing a problem with exiting Access in the following code
snippet:

If Len(MainDBDir) = 0 Then
DoCmd.RunCommand acCmdExit
Else
MainDBDir = MainDBDir & ":\Student Tracker"
End If

It seems that even when MainDBDir is zero length, the exit is ignored. I
have other instances of using the same exit command and it never fails.

Is there anything that could be causing this exit command to fail?

I am running a 2003 database using Access 2007. If I run the database using
Access 2003, it exits without failure. Somehow using 2007 for a 2003
database can cause problems.

Any help would be greatly appreciated.
 
Thanks for the help!
It did solve the problem. However, any idea as to why the other did not
work?

Don
 
RunCommand actions can be flaky and unpredictable because you cannot ensure
that they will act on the object that you wish. DoCmd.Quit explicitly tells
ACCESS to quit ACCESS...period.
 
Back
Top