Home » VB.Net

VBA Code Disappears from Access 2007 Database

I have an Access 2007 database application that was working yesterday, but today when I opened the file, all of the VBA code behind the forms stopped working. To be more specific - it appears all of the code modules for each form have disappeared from the project explorer as well as all of the class modules and standard modules. The odd part is that according to the form properties window in Access, each form still has the HasModule set to "yes". Also, all of the standard modules and class modules still appear in the Navigation Pane in Access - although if you try to open one from there, Access says they don't exist. If I try to delete the references from the Navigation Pane, they disappear then immediately reappear.

I am of course, able to revert to a backup of the file - but this is the second time it has happened in a month. I am mostly interested in the mechanism behind how this happened (how can the modules all disappear at once, while Access seems to hold onto some sort of reference to them).


1 Answer Found


Answer 1

Hi Rvs109,

Welcome to MSDN forum and we are very glad to help with you.

After reading your post, I knew your issue that the code modules for each form disappeared from the project sometimes. If I have misunderstood you, please let me know.

I haven't encountered this issue before, however, it seems that others ever experienced and here is the thread about this issue and some experts have provided the solution:

VBA module code disappear missing


I hope it can help you and feel free to follow up after you have tried the solution mentioned in the thread.

Best Regards,



<< Previous      Next >>

Microsoft   |   Windows   |   Visual Studio   |   Sharepoint   |   Azure