Finding a "ghost" reference

cricketbird

Registered User.
Local time
Today, 17:01
Joined
Jun 17, 2013
Messages
118
Whenever I try to add a new record to a form, I am getting a message that "You cannot add or change a record because a related record is required in table "TableDietOld".

I did create a table with this name when I was fiddling with the database. However, it no longer exists. I am trying to find what is trying to refer to this old table and I cannot find it.

I have tried:
1) Creating a new table with that name, and then running "Object Dependencies" (nothing)
2) Searching the project's VBA code (nothing)
3) Looking at all of the queries that underlie my form and its controls (nothing)
4) Importing all my objects into a new database (same issue) in case mine had gotten corrupted.

Where else can I look to find this wayward reference to a long-gone table?

:banghead:

Thank you,
CB
 
Go to the Relationship window and press *All Relationships*, find the *ghost* table and delete it.
 
Since the table doesn't exist, that didn't work. However, one table was linked to another database, and apparently someone else had named a table the same as my old table in THAT database, and the relationship was from there. Thanks for your help!
 
Hmmm, I thought THAT Relationship would show itself in the Relationships window. Oh well... glad you got it fixed!
 
FYI, deleting a table in the relationship window does NOT delete the relationship. It just hides the table. You must click on the relationship line and delete the relationship. Then you can delete the table to get it off the field.

The original problem was caused by having Name Auto Correct turned on when a table was renamed. This is a very dangerous "feature" and should always be turned off unless you specifically turn it on because you want to change some column names and you want the help it can provide. Just keep in mind that this feature does not work the way you think it does!!! NAC does not immediately change all references (and some it can never change anyway). It waits until you open the object the next time and if you make multiple changes that affect the same object, it can get confused. So, if I change tblA to tblAOLD, queries, forms, reports are NOT changed unless I actually open them so once you have made the changes, open every object to make sure the change gets propagated. Also, search for the paper published by MS on the topic and read it to see other gotchas.
 

Users who are viewing this thread

Back
Top Bottom