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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

More than one DAO.Recordset open

Status
Not open for further replies.

bllgnn

Programmer
Jan 20, 2002
42
Does anyone here know if it possible to have more than one DAO.Recordset open at the same time in the same Workspace and, if so, can there be a mix of tables and queries?
 
Certainly you can! You can declare as many variables As DAO.Recordset as you need. Each can be opened and used independently, using the OpenRecordset method of a TableDef, a QueryDef, a Database, or another Recordset object.

Since you seem to be somewhat new at DAO programming, let me give you a hint. Be sure to always close your Recordsets and Databases, and set all your DAO objects to Nothing when you're done with them. If you don't, a bug in DAO will sometimes prevent them being deallocated automatically (which should happen when you exit the procedure). The result is that Access will refuse to shut down. It may refuse to close the main window, or the window may close yet the taskbar button won't go away, or both window and taskbar will go away but it will still be on the Task List. Rick Sprague
 
Thank you very much for your valuable advice. I could not find that answer in the many books I have on using Access.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top