Need Macro to run cross tab query and export to access table


Devon B

Can someone help me write an access macro that will delete records from a
table, run a query, add records to the table? I am trying to add the records
from a cross tab query to a table. This table is used in another query that
feeds a access report. Currently, we are manually running the coss tab
query, export the records to excel then import that excel sheet in to the
access table. I need to try and automate this as much as possible.
I am not sure how to do this, or how to put it all together.


Steve Schapel


YOu can make a Delete Query to remove the existing records from the
table. You can make an Append Query, based on your existing crosstab
query, to add the new records to the table. You can use two OpenQuery
actions in your macro, one for the Delete and one for the Append.

Danny Moorehead


Try RunSQL on the drop down box, then use the Insert Into. Example is below
The name of my data base is results that i want to into from results1. This
example is inserting all fields from results into results1 and both
databases are the same

INSERT INTO results SELECT results1.* FROM results1


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