Thread: Cross-Tab query
View Single Post
 
Old March 3rd, 2008, 09:37 AM
mmcdonal mmcdonal is offline
Friend of Wrox
Points: 9,611, Level: 42
Points: 9,611, Level: 42 Points: 9,611, Level: 42 Points: 9,611, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2004
Location: Washington, DC, USA.
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

Can you open the query in designer view, and then click Query in the text menu, and then select Make Table query. This will make a table from your query results, which is good for the first run. Then change the query to an Append query for subsequent runs. Then also create a delete query for the new table. Then each time you want to fill the table, do this with your code:

DoCmd.SetWarnings False
DoCmd.OpenQuery "qryDELETEmyNewTable"
DoCmd.OpenQuery "qryAPPENDmyXTabData"
DoCmd.SetWarnings True

This will clean out old data, and repopulate your table with new data. Then DoCmd.OpeReport etc.

Did that help?



mmcdonal

Look it up at: http://wrox.books24x7.com