relationship doesn't show up. Another view?

G

Guest

I have created a relationship between two tables in access 2000, but once I
close the realationship window and reopen it, the relationship isn't there.
But if I create a query on these two tables in design view I see the
relationship. Is there a way to see a list of all the relationships that
exist?
 
A

Allen Browne

Where did you create this relation?
Relationships on the Tools menu?
Or just in a query?

Are these local tables (in the database)?
Or are they attached tables?
If attached, you need to create them in the back end database (i.e. the
database where the tables actually reside.)

Try clicking the Show All button on the toolbar in the Relationships window.

Is there any chance the tables are in the Relationships window, but off
screen? This can happen if you change screen resolution, orientation, or
have used multiple monitors.

If none of these occur, it's possible that something is corrupt in the
database. To fix it, uncheck the boxes under:
Tools | Options | General | Name AutoCorrect
Explanation of why:
http://allenbrowne.com/bug-03.html
Then compact the database:
Tools | Database Utilities | Compact/Repair

Still stuck? Loop through the Relations programmatically to see if the
relationship actually exists:

Public Function ShowRel()
Dim db As DAO.Database
Dim rel As DAO.Relation
Dim fld As DAO.Field

Set db = CurrentDb()
For Each rel In db.Relations
Debug.Print rel.Name, rel.Table, rel.ForeignTable,
RelationAttributes(rel.Attributes)
For Each fld In rel.Fields
Debug.Print , fld.Name, fld.ForeignName
Next
Next

Set fld = Nothing
Set rel = Nothing
Set db = Nothing
End Function
 
G

Guest

Ok thanks. So the relationship is in there, but as you can see it is in
there many times, since it wasn't showing up in the relationship screen, I
kept doing it. Is there a way to programatically correct this? And is there
a way to fix the relationship screen? Thanks

clientCodeClients clientCode Clients
ClientCode clientCode
clientCodeInvoice clientCode Invoice
ClientCode Client Code
clientCodeTiers clientCode Tiers
ClientCode Client Code
ContactsClients Contacts Clients ID1
contactID
ContactsinvContacts Contacts invContacts ID1
Client Code
ContactsinvContacts1 Contacts invContacts ID1
Contact ID
ContactsinvContacts10 Contacts invContacts ID1
Contact ID
ContactsinvContacts11 Contacts invContacts ID1
Contact ID
ContactsinvContacts12 Contacts invContacts ID1
Contact ID
ContactsinvContacts13 Contacts invContacts ID1
Contact ID
ContactsinvContacts14 Contacts invContacts ID1
Contact ID
ContactsinvContacts15 Contacts invContacts ID1
Contact ID
ContactsinvContacts16 Contacts invContacts ID1
Contact ID
ContactsinvContacts17 Contacts invContacts ID1
Contact ID
ContactsinvContacts18 Contacts invContacts ID1
Contact ID
ContactsinvContacts2 Contacts invContacts ID1
Contact ID
ContactsinvContacts3 Contacts invContacts ID1
Contact ID
ContactsinvContacts4 Contacts invContacts ID1
Contact ID
ContactsinvContacts5 Contacts invContacts ID1
Contact ID
ContactsinvContacts6 Contacts invContacts ID1
Contact ID
ContactsinvContacts7 Contacts invContacts ID1
Contact ID
ContactsinvContacts8 Contacts invContacts ID1
Contact ID
ContactsinvContacts9 Contacts invContacts ID1
Contact ID
invContactsInvoice invContacts Invoice
Invoice Number ID
invContactsInvoice1 invContacts Invoice
Invoice Number ID
 
G

Guest

Thank you all the programming worked great. I was able to run
db.relations.delete relationName and it deleted all of the relations I named.
Then when I checked in the visual form of the relations and added the
relation back it was good. Seems that there were too many copies of the one
relations causing it problems. thanks for all the help
 
A

Allen Browne

Excellent! Solved.

I haven't actually experienced that problem for years, so I'm wondering if
you may need to apply some updates for your version of Office, and also for
the JET engine. You can download both from:
http://support.microsoft.com/sp

The JET one is under Developer. They are both important.
 

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