Circular Reference

L

London

I made the mistake of building a circular reference for a
relationship between some queries. Now everytime I try to
open those queries the database just cuts off. It closes
on me. When I go to the relationship screen nothing shows
up so that I can "unhook" those relationships. I really
don't want to start totally over and time is a factor.
PLEASE HELP!!!
 
J

John Vinson

When I go to the relationship screen nothing shows
up so that I can "unhook" those relationships.

Did you create a relationship between Tables, in the Relationships
window? or within a Query? Or did you create a relationship between
Queries (I didn't even know you could DO that)?

Try opening the Relationships window and selecting the View All icon;
or if that doesn't work, click the X icon to clear the window, and
then the Add Table icon to add a table which you know to be in the
relationship, followed by the Show Direct button.

If all else fails... here's my little tactical nuclear device. BACK UP
YOUR DATABASE FIRST, this permanently and irrevokably destroys all
table relationships! Then copy and paste this to a Module and type

KillAllRelations

in the Immediate window.

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