Create a DAO Recordset from a table in the current database

The following code example uses the OpenRecordset method to create a table-type Recordset object for a table in the current database.

Dim dbsNorthwind As DAO.Database 
Dim rstCustomers As DAO.Recordset 
 
Set dbsNorthwind = CurrentDb 
Set rstCustomers = dbsNorthwind.OpenRecordset("Customers") 

Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.