I am working on an Access 2010 database in which a DAO recordset is used to create new record. However the code fails to ID the newly-created record -- it finds another record.
The developer was sloppy: he doesn't close recordsets. The code loops around a few times and I'm fairly certain multiple instances of the recordset are the cause of the problem.
Set rsMain = CurrentDb().OpenRecordset(strSQL, dbOpenDynaset)
' ... create new record ....
'rsMain.Close '' not included, unfortunately
'Set rsMain = Nothing '' not included, unfortunately
I want to Stop the code and see a list of open DAO recordsets. How can I use the Immediate window to query for all open recordsets? There must be a collection ready to view.
Resolved
I accepted an answer as helpful because it did a great job addressing my post. While I benefited, the answer I needed lay in a different direction -- VBA Object References. See my comments under Gord's answer.




