Stupid me... It's working. The error was happening further in the code. SORRY.
"franky" wrote:
[Quoted Text] > Hello. > > How do I open a recorset object by passing in the name of the query. For > example: > > Public Sub Testing(QueryName As String) > > Dim rst As DAO.Recordset > Set rst = CurrentDb.OpenRecordset(QueryName) > ... > > This will produce the following error; "Object variable or With block > variable not set". I've also tried;CurrentDb.OpenRecordset("""" & QueryName > & """"). I need to be able to pass the query name and NOTthe sql statement. > Any suggestions? > > Thanks in advance.
|