All relationships for a table deleted but still cannot modify it

  • Thread starter Confused of Paddington
  • Start date
C

Confused of Paddington

Table has 1 field which is the primary key. Have deleted all joins in the
relationships window. Just attempting to increase the field length. Message
says table is still part of one or more relationships.
Using Access 2000.
 
J

Jeff Boyce

How did you "delete all joins in the relationships window"? Have you tried
clicking on the toolbar button to "show all relationships"?

It may be that you think you deleted the relationships but Access doesn't...

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
J

John W. Vinson

On Tue, 10 Jun 2008 08:20:02 -0700, Confused of Paddington <Confused of
Table has 1 field which is the primary key. Have deleted all joins in the
relationships window. Just attempting to increase the field length. Message
says table is still part of one or more relationships.
Using Access 2000.

Just be aware that the relationships window isn't all that intuitive. If you
deleted the relationship by selecting and deleting the table icons, all you
did was hide those tables.

Select the "Show All Relationships" tool on the toolbar, and then select each
*join line* - not the table at the end of the line, but the line itself - and
delete it.

If (as can happen) there are hidden relationships, you can use this small
tactical nuclear device to destroy them all: copy and paste the following
routine into a new Module; save it as basRelationships; and type

Call KillAllRelations

in the Immediate window.

Compact the database after making your table changes, and then reestablish
relationships and compact again.

BE SURE TO BACK UP YOUR DATABASE FIRST!!!!

Sub KillAllRelations()
Dim db As DAO.Database
Dim rel As Relation
Dim inti As Integer
Set db = DBEngine(0)(0)
For inti = db.Relations.Count - 1 To 0 Step -1
Set rel = db.Relations(inti)
Debug.Print "Deleting relation "; rel.Name, rel.Table, rel.ForeignTable
db.Relations.Delete rel.Name
Next inti
End Sub
 

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