When I run the following code I get an error 3001: Invalid Argument
Here is my code:
Dim rsinstr As DAO.Recordset
Dim sql As String
sql = "SELECT qryEMS_TestResults.* FROM qryEMS_TestResults WHERE (((qryEMS_TestResults.CourseID)=[Forms]![frmEntry-Field]![cboLocateRoster]));"
Set rsinstr = DBEngine(0)(0).OpenRecordset(sql, dbSeeChanges)
I run something very similar without any problems. I do reference Microsoft DAO 3.6 Object library. If I take the sql code and run it as a query, I do get records. Any help would be greatly appreciated.
Here is my code:
Dim rsinstr As DAO.Recordset
Dim sql As String
sql = "SELECT qryEMS_TestResults.* FROM qryEMS_TestResults WHERE (((qryEMS_TestResults.CourseID)=[Forms]![frmEntry-Field]![cboLocateRoster]));"
Set rsinstr = DBEngine(0)(0).OpenRecordset(sql, dbSeeChanges)
I run something very similar without any problems. I do reference Microsoft DAO 3.6 Object library. If I take the sql code and run it as a query, I do get records. Any help would be greatly appreciated.