Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to find a corrupt record

Status
Not open for further replies.

MatthewP

Programmer
Jan 16, 2001
176
GB
I've got a corrupt record somewhere in Access and I don't know how to find it. Im running a query, and I get 'Record Is Deleted' as the recordset is being generated. When I click OK all the fields in the datasheet that have displayed turn into '#NAME?' instead of the original text.

I think this means a corrupt record somewhere, but how can I find out which one it is?

Thanks,
Matt.
 
Try this: Create a new module and add following code:

Function TestMe()

Dim dbs As DAO.Database
Dim rst As DAO.Recordset

Set dbs = CurrentDb
Set rst = dbs.OpenRecordset("YourTableName")

While Not rst.EOF

Debug.Print rst!SomeFieldInTheRecord

rst.MoveNext

Wend

End Function

This might tell you what record is erroring out.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top