Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"File not found" at the execution of any VBA code in Access 2007

Tags:

vba

ms-access

I'm working on a big Access 2003 project with Microsoft Access 2007­. Recently, some users have started to experience problems with the buttons in my forms. For example, without any specific reason, clicking on a button or trying to execute any code will return the error:

File not found

There is no way to go into debug mode. When this happens the only thing to do is to restart the database. I tried adding the Stop command at the beginning of the executed block to try debugging it, but no code is executed at all. It's like a compilation error but it's only happening 5-10% of the time, which is really weird.

After some research, I found other people are having the same problem, for example this and this link. There are other examples too, with no real solutions yet.

My database can be okay for a week and then the problem starts to happen again. Half the time and users can't do much; they need to restart the database once or twice to get it back working, and after a few minutes the error might happen again.

Because this is Access 2007 and there are a lot of people experiencing this bug, I can't believe it isn't more documented.

What's the problem? Is the database somehow partially corrupted? What should I do? This is really annoying.

like image 936
dan Avatar asked Apr 10 '13 17:04

dan


2 Answers

If I was in this situation one of the first things I would try would be to do a complete decompile+compact+recompile operation on the front-end database file, and then distribute that updated front-end out to the users to see if that improves things.

Detailed instructions on the decompile+compact+recompile steps are available here. Note: Be sure to read David W. Fenton's additional recommendations in his answer.

like image 119
Gord Thompson Avatar answered Sep 16 '22 15:09

Gord Thompson


I had just experienced this for the first time. I had been making extensive coding changes in a form, and was required to reboot my PC without finishing debugging the code. When I opened the app, I immediately got the "file not found" message (it auto-starts a different form).

On a whim, I went to the form in question and commented out that entire module's code and the problem went away. After I went back in and uncommented that code, everything still worked as normal. I was able to continue debugging that code and lived for the rest of the day happily.

like image 28
Dennis Flory Avatar answered Sep 19 '22 15:09

Dennis Flory