I am using VBA in Access to create a recordset with a passed parameter from an input box. The query is run on two tables. When I run the code I get an err message "No Current Record". It's passing the parameter so I don't understand what the problem is.
Dim strSQL as String
Dim rst As DAO.Recordset
strSQL = "SELECT ... FROM ... WHERE ... ORDER BY ..."
Set rst = Currentdb.OpenRecordSet(strSQL, <options>)
To identify the cause of an error in the SQL statement, copy the contents of strSQL from the immediate window (debug.print strSQL) and paste it in the Query Designer (set in SQL View). When you switch to Datasheet View it will point out where the problem is, if any: Perhaps there is no record matching the criteria.