Access 2007 errors: "Invalid procedure call" and "Error accessing file. Network connection may have been lost."

On Tuesday (Oct 25) we started getting these two errors when trying to run certain reports and forms in an Access 2007 database that prior to this has worked without issues.

Its now Oct 26, 2011 and I have researched the problem all morning.  I found several fixes for Access 2000, nothing for Access 2007.  Our corporate laptops are running Windows XP and Office 2007, and are up to date on Service Packs.

When the problem first started, I would get the "Invalid procedure call" when I tried to run certain reports.  The error pops up immediately, I OK the dialog and go into  VB.  The debugger is always stuck on the "Private Sub Report_Open(Cancel As Integer)" of the report I tried to run.  If I clear it all and bring the report up in Design mode, I cannot click on the editor elipses in the Event tab of the Property sheet, even though it states [Event Procedure] right next to it.  When I click on the elipses, nothing happens at all.  If I delete all the VBA code, I can then bring up the Code Editor and there is a new Private Sub Report_Open(Cancel As Integer).  Not all reports have this problem.

One of the first fixes I tried was to Compact and Repair the DB.  That is when I started getting the "Error accessing file.  Network connection may have been lost." error and noticed that I got it for certain Forms also.  This one really made me scratch my head since there is no Network drive or connection involved in running this DB.  The VBA issue appears to be the same however, in debug mode, stuck on Report_Open or Form_Open.

Currently I am working on building a new DB to replace this one, importing all of my reports forms etc after having set them to HasModule=No, but what a PITA.

Any ideas would be greatly appreciated

 

Thank you

Steven Wheeler

Answer
Answer

One of the first things I would try is decompiling the database, in case the problem is caused by corruption in the VB project.  If you don't know how to do that, see this link (out of many you'll find if you search for "how to decompile access database":

    http://www.fmsinc.com/MicrosoftAccess/Performance/Decompile.asp

 

The example command lines in that link are for Access 2010, but you can modify them for Access 2007 by changing "Office14" to "Office12".

Dirk Goldgar, MS Access MVP 2001-2015
Access tips: www.datagnostics.com/tips.html

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

Answer
Answer

Hi,

 

 

As for the first issue, you need to compile your VBA application and check whether it exists programming syntax errors in VBA application. or add a breakpoint at the line of "Private Sub Report_Open(Cancel As Integer)" to debug the program step by step. make sure that there are no references missing.

 

But for the second issue, you can copy your database to another computer and create a blank new database on that computer and import all database objects into this new database.

 

 

 

Best regards

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

 
 

Question Info


Last updated October 5, 2021 Views 2,110 Applies to: