Access/VB returning "Module Not Found" error

G

Guest

VB returning "Module Not Found" error
Hello,

My Access application has a Main Menu and Report and Maintenance sub-menu
structure using command buttons. On the report menu, I have a command button
to list all active users. This presents the users with a choice: 1) Display
the info on a datasheet, or 2) run a report of the same information. This is
basically a listing all current employees. I don't know what changed, but
suddenly, when I click on the button to run the List Active Users, VB
returns the error.

I then switch to the VB Debugger to find it has stopped at the top of the
procedure ("Private Sub cmdListActiveUsers_Click"). This of course is the
code to execute for the Click event. Note that execution actually stops
before the first line of code in the procedure. It actually breaks on the
title of the procedure. I have deleted this entire section of code, deleted
and re-created the command button and associated code w/o resolution.

I have also just noticed that this problem has spread to a lot of command
buttons used for navigating through menus or to display datasheets/reports.

Can anyone explain why this is occurring and how to resolve it?

TIA,
Rich
 
K

Ken Snell \(MVP\)

Sounds like the form has become corrupted. You may need to rebuild the form
from scratch.
 
G

Guest

Do you know this to be a problem with Access 2003? This is occurring all
over the project.
 
M

Marshall Barton

rich said:
VB returning "Module Not Found" error

My Access application has a Main Menu and Report and Maintenance sub-menu
structure using command buttons. On the report menu, I have a command button
to list all active users. This presents the users with a choice: 1) Display
the info on a datasheet, or 2) run a report of the same information. This is
basically a listing all current employees. I don't know what changed, but
suddenly, when I click on the button to run the List Active Users, VB
returns the error.

I then switch to the VB Debugger to find it has stopped at the top of the
procedure ("Private Sub cmdListActiveUsers_Click"). This of course is the
code to execute for the Click event. Note that execution actually stops
before the first line of code in the procedure. It actually breaks on the
title of the procedure. I have deleted this entire section of code, deleted
and re-created the command button and associated code w/o resolution.

I have also just noticed that this problem has spread to a lot of command
buttons used for navigating through menus or to display datasheets/reports.


The first thing to do is make a backup copy of your mdb
file.

I can think of two things that can cause those symptoms.
The first and easiest to deal with is when your module has a
compile error. With the module open in the the VBE click on
the Debug - Compile menu item. If it complains about
anything, try to fix the offending line(s?) of code.

If you are seeing the problem in many modules, then I
strongly suspect that some of the VBA code has become
corrupted. Take a good look at:
http://allenbrowne.com/ser-47.html

After you get back to a stable situation, then look at:
http://allenbrowne.com/ser-25.html
Especially the part about switching to design view before
editingand or compiling any of a form/report's VBA code.
 
K

Ken Snell \(MVP\)

It's not a common error, no -- but corruption does occur in files, primarily
while you're developing / modifying the design/code. If you're seeing it all
through the project, then the corruption probably has become extensive.

You may want to decompile the database. Make a backup copy of the database
file, then use Start | Run to run this program (replace generic path/file
names with actual names):

"msaccess.exe" /decompile "PathTomdbFile\Filename.mdb"

This may eliminate the problems that you're seeing.
--

Ken Snell
<MS ACCESS MVP>
 
D

David W. Fenton

Do you know this to be a problem with Access 2003? This is
occurring all over the project.

You haven't been taking good care of your code, then. If you compile
regularly and have COMPILE ON DEMAND turned off, and decompile
occasionally, you should never see any corruption develop, except in
the weird situations where Access might crash in the middle of
compiling. That doesn't happen very often.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top