PDA

View Full Version : Solved: Dissapearing module



Lance-R
01-31-2008, 06:05 PM
Howdy All,

I had a module off of my main form, and then decided that I also needed a main module. I created a module off of the project and it gave it the name module1. I was unable to figure out how to rename it, but figured in the end it really didn't matter. When I closed Access it asked me something about wanting to save my two modules, when I said yes, then it let me rename it. Now today I opened the application up, and the module was completely gone.

It's easy enough to recreate the code, but I want to make sure I do it in a way that won't get it nuked again.

Oorang
02-01-2008, 07:31 AM
In Access Standard Modules, Class Modules, Userforms, and Access Forms all have to have unique names. By naming the new Module Main you overwrote the old one.

Lance-R
02-01-2008, 10:44 PM
actually the form was called 'formMain' and the module was just renamed 'Main', anyway I created a module named Main again, and it hasn't dissapeared yet, but I guess I'll be doing lots of backups. Thanks.

Oorang
02-02-2008, 08:08 PM
It will be called "form_main" in the VBE, but the actual name will be Main. (All access-forms get the prefix in the vbe due to subclassing.) But that isn't it's access-object name (ie the name you typed in the database window.) As long as the names in the database window stay unique you should be fine.
(Unless it's a corruption issue.)