dynamically generated crosstab query

C

chuckfuller

I'm having trouble with a dynamically generated crosstab query.
Basically, I've dynamically generated the correct query string with
VBA, but now I want to take the results of that query and filter them.
For example, I'd like to do something like this:

SELECT * FROM <name of crosstab query>
WHERE <some criteria>

The problem is that since the crosstab query is dynamically generated I
can't reference it from this second query. Is there a way to save the
dynamically generated query to an object so that I can reference it
from the second query?

Thanks!
Chuck
 
D

Duane Hookom

Create a query with any sql and save it as "qxtbDynamic". Then take your
generated SQL statement and use some DAO code to apply the SQL to the
querydef object.

CurrentDb.QueryDef("qxtbDynamic").SQL = strSQL

You now have a saved query with the appropriate SQL.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top