How do you open the results of a sql select statement without creating a permanent query object? Here's the basics of what I've been trying to do in a VBA module:
--------------------------------------
Dim Q as querydef
Set Q = CurrentDb.CreateQueryDef("", "select * from Table order by lastname, firstname")
--------------------------------------
I'm trying to get this sql statement to "open" as if one was opening a preexisting query. So far the most I've gotten is an error statement about being unable to "find" the temporary querydef. Thanks in advance to anyone who has the solution.
--------------------------------------
Dim Q as querydef
Set Q = CurrentDb.CreateQueryDef("", "select * from Table order by lastname, firstname")
--------------------------------------
I'm trying to get this sql statement to "open" as if one was opening a preexisting query. So far the most I've gotten is an error statement about being unable to "find" the temporary querydef. Thanks in advance to anyone who has the solution.