Hello all,

I have a problem that I have been able to solve, but I'm looking for a more efficient way to solve it. Pretty much I have a form where a user can add, edit and delete records from a table. When the user goes to add or edit a record, it checks through all current records to ensure that the user isn't adding or editing to a name that already exists.

My problem is that when a user deletes a record from the table, and then tries to add or edit a record, I get an error message saying 'record is deleted'. Now, I was able to solve this problem by opening and closing the recordset before running through each record, however, this doesn't seem like a terribly efficient way of doing this, especially if there are a lot of records.

The reason why I had to open and close the recordset is because it wasn't updating the amount of records - after deleting a record it would still think the record is there, hence the 'record is deleted' error message. I thought in ADO, that when you move to a different record, the recordset is updated? I tried calling the .Update method and .UpdateBatch method on the recordset to see if it would do anything, but it didn't seem to help. Any one have any ideas as to why the recordset keeps the deleted record in the recordset, and how I can solve this problem without having to open and close the recordset?

Thanks for any help,

Brian