Microsoft Access has stopped working... RRS feed

  • General discussion

  • Hi all,

    I have a large database with several forms. Everything was running smoothly untill this morning. Now suddenly one of my forms does not open. Everytime that I launch this form, I get a message "Microsoft Access has stopped working...".

    This happens only on this specific form. All other forms and functions run without any problems.

    Is there a way that I can troubleshoot this form to see where or what the issue is?



    Monday, July 23, 2018 6:54 AM

All replies

  • Is there a way that I can troubleshoot this form to see where or what the issue is?

    Hi Deon,

    Did you try the debugger to step through the code line by line?


    Monday, July 23, 2018 8:22 AM
  • Hi Imb,

    I cannot use the debugger. As soon as I launch or open the form, I get the message.

    I have restored the form from my backup and is working fine now. I assume there was some corruption when I started the database this morning. Am I correct in my assumption?



    Monday, July 23, 2018 8:54 AM
  • Hi Deon SA,

    Maybe the form has been corrupted. You can try the following:

    Create a completely new form and open it in the design view. Copy the controls from your original form and paste it into the new one. Also copy the VBA code from your original form and paste it into the new one.

    I hope for you that it works.

    Monday, July 23, 2018 9:50 AM
  • Hi Deon

    This is something I have used with success. Thanks to Allen Browne!

    (I have used it with Access 2007, 2010, 2013 and 2016 - 32 bit)

    Allen Browne pages

    SaveAsText / LoadFromText

    This is an undocumented technique that may rescue a bad form or report by exporting it to a text file, and instructing Access to recreate it from the text file.

    1. Make a backup of your database.
    2. Open the code window (Ctrl+G) and look through the modules (Windows menu.)
      If you can see a module for this form/report, copy the text out to Notepad, and save it.
    3. Open the Immediate Window (Ctrl+G), and export the form/report as a text file. Enter something like this:<tt>    SaveAsText acForm, "Form1", "C:\MyFolder\Form1.txt"</tt>
      substituting your form name for Form1 and your directory for MyFolder.  Use <tt>acReport</tt> if the problem object is a report.
    4. Verify that the text file was created in the folder you specified.
    5. Delete the form from the database.
      Select it in the Navigation Pane (Access 2007 or later) or Database Window (previous versions), and press Del.
    6. Compact the database:
              • In Access 2010, Compact and Repair Database on the Database Tools ribbon.
              • In Access 2007, click Office Button (top left) | Manage | Compact.
              • In Access 95 - 2003, Tools | Database Utilities | Compact.
    7. Open the Immediate Window (Ctrl+G). Enter something like this:<tt>    LoadFromText acForm, "Form1", "C:\MyFolder\Form1.txt"</tt>
      substituting the same things you did at Step 3 above.

    You will receive an error message at Step 3 if Access cannot make sense of the form to export it. You will have to delete the form and re-create it, but if you saved the code at Step 2 you can at least paste that back into the new form's module after you create it.

    If Step 3 works without error, there is a good chance the rest of the steps will succeed too.

    Cheers // Peter Forss Stockholm

    Monday, July 23, 2018 1:31 PM
  • Hi Deon SA,

    Maybe the form has been corrupted. You can try the following:

    Create a completely new form and open it in the design view. Copy the controls from your original form and paste it into the new one. Also copy the VBA code from your original form and paste it into the new one.

    I hope for you that it works.

    I would not copy controls from the corrupt form onto a new form. You might be just copying over the corruption. The SaveAs/LoadAs method described will probably fix the issue, but if it doesn't, build a new form from scratch if you don't have a good backup.

    Bill Mosca

    Monday, July 23, 2018 9:04 PM
  • Hi Deon,

    I've had similar issues with our MS Access solutions running in Office 365 ProPlus on Win 7 Professional.  After spending many days Googling for answers and trying every suggestion under the sun, I eventually discovered a couple of workarounds that has "solved" our issues of MS Access experiencing "has stopped working" and "Not Responding" errors.  For several of our Access solutions, we found that if we eliminated the Autoexec macro, then they opened without any errors each time.  However, because we still needed to have a macro autostart upon opening the Access file, we instead setup a .bat file with "msaccess.exe /x" followed by the name of the macro in the command line.  Then we created a shortcut icon that launches the .bat file.  We haven't had any issues since!  And this is happening with a handful of different Access files.  I'm not sure why, but there appears to be a problem using the autoexec macro.  And we never had any issues with these solutions before we transitioned from Office 2016 to Office 365.  But these problems didn't manifest immediately after we installed Office 365.  Our issues began several weeks later and so we suspect that our IT department had pushed an update that might have introduced these issues.  We're not sure if it was an Office update or a Windows OS update or a combination of both.

    We also experienced random intermittent issues with "has stopped working" type errors by simply opening MS Access from the Start button.   I don't understand it, but we cannot duplicate these issues if we right-click on "Access 2016" from the Start button and select "Run as Administrator".  Go figure!  And because we schedule many of our Access solutions from the Task Scheduler in Control Panel to run at a specified time each morning, it appears that our scheduled Access solutions will run better if run from an account that has Administrator privileges and the "Run with highest privileges" box is checked in the "General" tab from the Task Scheduler. 

    So in summary, my tests show that if we avoid using the autoexec macro and run with admin rights, then these errors go away.   When I have more time, I'll try to further isolate the issue.  We may need a few more days to monitor our scheduled MS Access processes to confirm whether these workarounds really work for the long term.  I will post back at a later date and give another update.



    Saturday, July 28, 2018 4:51 AM
  • Hi Hans and Deon,

    It seems strongly that the error lies with you and not with Access. Because if you eliminate macros, you may have also eliminated those macros that contain an error; or in the order the procedures are executed.  I would carefully check the assignments in the macros. I never work with macros myself, but with VBA functions. Then you are much more dynamic. With code you can better determine what has to happen under various circumstances.

    It's just an idea...

    Saturday, July 28, 2018 7:22 AM
  • On my Win7 PCs, I have Scheduled Tasks that kick off about 15 different MS Access files at different times of the day.  No more than 5 or 6 run at the same time.  And only those that used the AUTOEXEC macro were experiencing random "Microsoft Access has stopped working" and "Microsoft Access is not responding" errors.  But when I replaced this macro with another one having a different name that was directly called from a command line using the /x switch in Windows Task Scheduler, our issues seems to have disappeared.  So the bottom line is that we still use a macro that essentially calls the same VBA procedure.  We did not eliminate the general use of macros.  We just discontinued using a specific type of macro, named AUTOEXEC, and replaced it with another one, which then gets called from a command line in Scheduled Tasks using the "/x" switch.  Here is an sample command line:

          c:\> msaccess.exe path\filename.accdb /x macro_name

    One other caveat that may need to be stated is that our AUTOEXEC macro was calling the CheckCommandLine() function, which checks the "/cmd" switch from the command line that initially executed or opened our Access (.accdb) files from Scheduled Tasks or from a batch (.bat) file.  So the problem may not be with AUTOEXEC, but with the CheckCommandLine() function called by the macro or the combination of the two.  And I am not yet certain whether "Run As Administrator" (mentioned in my previous entry) was even necessary.  I haven't had time to test the various combinations.

    In summary, we now have a command line that directly calls a macro with the use of the "/x" switch which then calls the same exact procedure in VBA as before and are not experiencing any issues thus far.  And we stopped using the CheckCommandLine() function and stopped using autoexec.



    Saturday, July 28, 2018 1:32 PM
  • Hi Hans and Peter,

    Thanks for the suggestions. Much appreciated.

    I have done a similar file that was mentioned by Hans (the .BAT file). The only difference is that I used a .CMD file to launch Access with the below:

    START /I "MSAccess.exe" C:\"Packing List Front End"\"Packing List System NEW.accdb".

    This also seems to resolve the "Stopped working" message.



    Monday, July 30, 2018 6:01 AM