From: Jeff Forster on
I have an Access 2007 database in which the code behind the forms and
in the modules disappeared. Overnight, bam, gone.

I don't want to import the tables into a new file because I don't want
to have to rebuild the relationships. So, I'm trying the route of
deleting everything with code (forms, modules) and bringing it back in
from a good file. I wrote a bit of code to delete all the forms.
I've brought good forms back in. The thing is now, I can't delete
the modules. When I try to delete them one by one (there aren't that
many), they disappear for a second and come back. When I reimport
them, they come in with 1 at the end of the names (of course). But
then, I cannot rename them to the names referred to throughout the
database. Trying to change Utilities1 to Utilities results in similar
behavior - rename for a second then revert to Utilities1.

I'm a day into this, and I'm going a bit bats.

I understand that code disappearing from forms is a known problem with
2007. Should I give up and brace myself to start rebuilding table
relationships?

Jeff
From: Salad on
Jeff Forster wrote:
> I have an Access 2007 database in which the code behind the forms and
> in the modules disappeared. Overnight, bam, gone.
>
> I don't want to import the tables into a new file because I don't want
> to have to rebuild the relationships. So, I'm trying the route of
> deleting everything with code (forms, modules) and bringing it back in
> from a good file. I wrote a bit of code to delete all the forms.
> I've brought good forms back in. The thing is now, I can't delete
> the modules. When I try to delete them one by one (there aren't that
> many), they disappear for a second and come back. When I reimport
> them, they come in with 1 at the end of the names (of course). But
> then, I cannot rename them to the names referred to throughout the
> database. Trying to change Utilities1 to Utilities results in similar
> behavior - rename for a second then revert to Utilities1.
>
> I'm a day into this, and I'm going a bit bats.
>
> I understand that code disappearing from forms is a known problem with
> 2007. Should I give up and brace myself to start rebuilding table
> relationships?
>
> Jeff

Where the errors occured that I read about with others that suffered the
same problem, the mdb was not split into an FE/BE.
From: Albert D. Kallal on
"Jeff Forster" <forsjef(a)gmail.com> wrote in message
news:cd9d1515-6d86-4655-b4df-966288da97ab(a)o26g2000vbd.googlegroups.com...
>I have an Access 2007 database in which the code behind the forms and
> in the modules disappeared. Overnight, bam, gone.
>
> I don't want to import the tables into a new file because I don't want
> to have to rebuild the relationships.

The above is incorrect information, you always been able to import
relationships along with the tables intact to a new database. In fact, I
quite sure that going all the way back to the original version of access
released about eighteen years ago behaves this way.

So to import related tables, the relationships should come over correctly
during an import. I'm not sure why that's not working for you.

When you do use the external data import tables note the options button that
you can expand for MORE options during that import. You should see the
option to select the importing of relationships (and in fact that option is
selected by default). You also see in that options panel the ability to
import things like custom menus.

So keep in mind while the above may not solve your issue of the missing code
modules, you certainly should and can import the tables with their
relationships intact into a new database.


> I understand that code disappearing from forms is a known problem with
> 2007.

Do you have an link or some supporting evidence for this claim? This would
be new information and new news to me.

So, I would suggest you try importing to a new blank database.

> Should I give up and brace myself to start rebuilding table
> relationships?

As mentioned the above is incorrect. For about 18 years now you always been
able to import data tables and keep their relationships intact when you do
as such. So, this behavior has not changed, and should not be considered an
obstacle to importing the tables into a new clean database.

Regardless, if your original databases is damaged strongly suggest that
anything you attempt when trying to recover any part of the damaged
application is to be working on a copy of that file.

Are you able to copy the code models into another blank database, does that
work?

There is some notes and suggestions on corrupted database here:
http://www.granite.ab.ca/access/corruptmdbs.htm

And the above some tips a suggestion are to recover parts of your
application, it might be of help you.

--
Albert D. Kallal (Access MVP)
Edmonton, Alberta Canada
pleaseNOOSpamKallal(a)msn.com




From: David W. Fenton on
"Albert D. Kallal" <PleaseNOOOsPAMmkallal(a)msn.com> wrote in
news:HyJ7n.27709$_96.25110(a)newsfe02.iad:

> you always been able to import
> relationships along with the tables intact to a new database. In
> fact, I quite sure that going all the way back to the original
> version of access released about eighteen years ago behaves this
> way.

And it's always been the default! That is, you have to do something
to *not* get the relationships. I know this because two days ago I
wanted to import without relationships and assumed since I hadn't
specifically checked it, they wouldn't import. So I had to kill that
file and start over, this time explicitly choosing to *NOT* import
the relationships.

--
David W. Fenton http://www.dfenton.com/
usenet at dfenton dot com http://www.dfenton.com/DFA/