Error Message: The search key was not found in any record

dealwi8me

Registered User.
Local time
Today, 07:30
Joined
Jan 5, 2005
Messages
187
Hello all,

I try to delete a record and i get this error message "The search key was not found in any record". The key of the table is an autonumber but for some reason in these two records i want to delete has value = 0 .

Any suggestion how to delete these two records?

Thank you in advance!
 
The key of the table is an autonumber but for some reason in these two records i want to delete has value = 0 .

If the Prime Key of a table is an autonumber and you have two records for which the Prime Key is 0, you have a damaged table. There is no other way for this to exist. Try to repair your database.

Now... there are a myriad of ways for this to NOT exist - but look like it DOES exist. For example, if you run a query that does an outer join (which has LEFT and RIGHT variants) and the table with this aberrant key is on the "other side" of the join, you could get a case where the table driving the JOIN has no match among the records on the other side. This would return zero for the fields that come from the "other" table. You would see the zeros but they aren't really there.

Another issue could be whether the key with the zero values is the prime key or merely a key that allows duplicates. Again, that could allow you to have the results you descibe.
 
If the Prime Key of a table is an autonumber and you have two records for which the Prime Key is 0, you have a damaged table. There is no other way for this to exist. Try to repair your database.

That work thanks! :)

Any ideas why that happened?
 
Windows uses write-behind technology sometimes, and if it was a shared database across a network, this is even more relevant.

Anything that causes Access to shut down abnormally before it can finish the deferred writeback operations (or before WINDOWS can do so) will cause some problem. The one you describe is well within the range of possible aberrations you can see. The actual result isn't really predictable, but what you saw is surely possible.

If you are sharing this database with someone who likes to turn off his/her machine without exiting from Access, I very strongly recommend you take a stiff ruler to that back of that person's hand. If that doesn't work, promise that the next time, there will be a long thumbtack in the rule. After that, try a ten-penny finishing nail.
 

Users who are viewing this thread

Back
Top Bottom