I'm trying to set an Access Forms recordset to an ADO recordset containing a list of tables in an Access .mdb database
with the following code
I get a Runtime Error 7965 / the object you entered is not a valid recordset property at line
Set Forms!frmData.Recordset = rst
I know the recordset was created ok because the debug.print statement returns a table name from the database
also I have successfully used this same code when I return a list of tables from a MS SQL Server database
with the following code
Code:
[indent][/indent]Set rst = objConnection.OpenSchema(adSchemaTables)
rst.MoveLast
rst.MoveFirst
Debug.Print rst!TABLE_NAME
Set Forms!frmData.Recordset = rst
rst.Close
objConnection.Close
Set Forms!frmData.Recordset = rst
I know the recordset was created ok because the debug.print statement returns a table name from the database
also I have successfully used this same code when I return a list of tables from a MS SQL Server database