Complile Error

R

Rod Coate

I have a database with many forms and associated vba code.
I deleted one of the forms, but the form code is still
there. The VB window will now not compile and if I try to
open the form code from the VB window I get the following
message - "The form name xlCreateNewSnapshot is misspelled
or refers to a form that does'nt exit". The option to
remove is greyed out on the right button menu when I right
click on the offending form code in the project window.

Is there any way I can remove this?

Thanks.
 
S

SA

Rod:

This can be a tough problem. Your final back up solution is to create a
new empty db container and import all the objects from the existing db.

You can however, try to decompile the database first, compact and repair and
then try to delete the offending module before recompiling. But before you
attempt that, if you are running Access 2000, then make sure you are running
at least service release three (SR 3) which can be downloaded from the
Office update site.

To decompile do the following:

1.) Back up your existing db.
2.) Create a shortcut on your desktop to MSAccess.exe
3.) Open the properties for the shortcut and in the target option, add to
the existing path to MSAccess, the following:

a quoted fully qualified path to your db followed by the /decomple switch as
in:

"c:\office\office\msaccess.exe" "c:\mydir\mydb.mdb" /decompile

(adjust paths as necessary note the quotes)

4.) Hold down the shift key and launch the short cut, then compact and
repair, then try to delete the code module.
5.) If successful, then recompile, compact and repair.

HTH
 

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