Access database will not restart after using VBA to close until I reboot

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • gnawoncents
    New Member
    • May 2010
    • 214

    Access database will not restart after using VBA to close until I reboot

    Greetings--I'm hoping someone who has had this problem before can help me find a way ahead.

    Problem: When I use VBA or a macro to close my database, I cannot reopen it without rebooting my computer. When I try to reopen, the record locking file appears, but the database never opens nor does it appear in the Task Manager.

    Update: I also get this problem when closing the database using the "x", but only after this particular form has been opened. There are no other open forms, and the form is not linked to a table or query of any sort.

    I am running Access 2013 on Windows 8.1 Enterprise (64 bit).

    I have tried using the button wizard to embed the macro that closes Access as well as various options in VBA directly (docmd.quit, docmd.closedata base, access.quit, and a few others) but all result in the same problem.

    Ideas? Thanks in advance for any help.
  • PhilOfWalton
    Recognized Expert Top Contributor
    • Mar 2016
    • 1430

    #2
    No idea but questions that might help someone.

    Are you running this as a front end / back end DB?
    If so are you running on a network or single computer?
    If so are the tables linked directly to the FE database?
    When you use something like DoCmd.Quit, does the .LDB lock file vanish?
    Again in a FE /BE situation. there will probably be a lock file for both the FE database & BE database. What happens with these?

    Phil

    Comment

    • jforbes
      Recognized Expert Top Contributor
      • Aug 2014
      • 1107

      #3
      You also might want to try repairing your Office installation.

      Comment

      • gnawoncents
        New Member
        • May 2010
        • 214

        #4
        Thank you for the inputs.

        Additional information:
        - I am running this as a front end with a split backend.
        - I am currently developing the database, so I'm running it on a single computer
        - This particular form that is causing the problem (it doesn't happen with any other form) is not linked to any tables, so the backend does not engage.
        - When I close the database manually or via VBA, the lock file vanishes. When I try to reopen the database, it reappears but the program never opens. It can no longer be closed/deleted at this point without a computer restart.
        - Just to clarify, this problem only presents with this particular form and no other. The form contains a label, a text box that populates on form startup (see below) and the button to quit/close.

        Code:
        Option Compare Database
        
        Private Sub Command5_Click()
        
        Application.Quit
        
        End Sub
        
        Private Sub Form_Open(Cancel As Integer)
        
        txtUsername = "No existing profile was found for you (Username: " & Environ("USERNAME") & ")."
        
        End Sub

        Comment

        • PhilOfWalton
          Recognized Expert Top Contributor
          • Mar 2016
          • 1430

          #5
          Don't think it will help, but IMO you should always use Option Explicit after Option Compare Database in all your modules. That will check that references are correct.

          You should have 2 lock files (one for the data and one for the program) once the DB has successfully opened, and both should vanish when the DB closes.

          Have you tried decompiling the database?
          Have you tried creating a new database and importing all objects?
          Have you tried re-installing Office?

          Phil

          Comment

          • gnawoncents
            New Member
            • May 2010
            • 214

            #6
            Thank you for the suggestions. Unfortunately, I do not have the luxury of re-installing Access without going through a lot of red tape at work and a long wait after, so I'm pressing through what I can until then. I have, however, through a process of elimination been able to pinpoint the problem.

            UPDATE: The problem occurs when I set the form to "Pop Up." if I set Pop Up to NO, the problem disappears. Unfortunately, I need the form to be a Pop Up. I even tried recreating the form to the same effect--every time I set it to Pop Up, Access will not restart without rebooting my computer. Has anyone experienced anything like this before?

            Comment

            Working...