Relationships keep on disappearing

D

Darren

Relationships keep on disappearing when the application is saved and closed.
Any Ideas?
 
A

Allen Browne

Presumably these are local Access tables, not attached tables?

Open the Relationships window (Tools menu).
Click the Show All button (toolbar).

If that's all in order, make sure that the Name AutoCorrect boxes are
unchecked under:
Tools | Options | General
Then compact the database:
Tools | Database Utilities | Compact.

If the relations still don't show up, then there is a corruption in the
database. The next step is:
1. Create a new (blank) database.

2. Turn Name AutoCorrect off.

3. Import your tables:
File | Get External | Import
Under the Advanced button, choose NOT to import the relations.

4. After importing all the tables, create the relations in the new database.

5. Close, and reopen the database to check the new relationships hold.

6. Import all the other objects (queries, forms, ...)

7. Open the Immediate window (Ctrl+G), and set your references (Tools |
References).

If there is some reason why creating the new database is an undesirable way
of getting an uncorrupted result, you can use the code in this link to
programmatically delete all your relations:
http://allenbrowne.com/DelRel.html
Then compact, and create the relations again.
 
D

Darren

Thanks Allen,

It worked like a dream.

Allen Browne said:
Presumably these are local Access tables, not attached tables?

Open the Relationships window (Tools menu).
Click the Show All button (toolbar).

If that's all in order, make sure that the Name AutoCorrect boxes are
unchecked under:
Tools | Options | General
Then compact the database:
Tools | Database Utilities | Compact.

If the relations still don't show up, then there is a corruption in the
database. The next step is:
1. Create a new (blank) database.

2. Turn Name AutoCorrect off.

3. Import your tables:
File | Get External | Import
Under the Advanced button, choose NOT to import the relations.

4. After importing all the tables, create the relations in the new database.

5. Close, and reopen the database to check the new relationships hold.

6. Import all the other objects (queries, forms, ...)

7. Open the Immediate window (Ctrl+G), and set your references (Tools |
References).

If there is some reason why creating the new database is an undesirable way
of getting an uncorrupted result, you can use the code in this link to
programmatically delete all your relations:
http://allenbrowne.com/DelRel.html
Then compact, and create the relations again.
 
Top