Access 2010 Macro to run make table query

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

SWinchester2010

Thread Starter
Joined
Jan 9, 2012
Messages
3
I have several queries that I run daily to update sales, shipments, etc. How do I set up a macro to run a make table query and then export the table to another access database? (The query deletes the records already in the table before re-populating.) If possible, I would prefer to not open the query, just run it. Please know that I am a very new user of Access, so I may need step-by-step examples.
Thanks for your help!
 

OBP

Joined
Mar 8, 2005
Messages
19,895
Are you sure that you need a maketable query?
Won't an append or update query work?
Also why do you then need to export the table, can't this be done in the other database?
 

SWinchester2010

Thread Starter
Joined
Jan 9, 2012
Messages
3
This is part of a series of queries that I run on a daily basis. Yes, I believe I need a make table query, as the data can (and usually does) change every day. I'm really struggling with macros in 2010! Do I need to open the table and delete the current data before running the query?
Thanks!
 

OBP

Joined
Mar 8, 2005
Messages
19,895
You say "as the data can (and usually does) change every day", in what way does it "Change"?

You can simply use a Delete query to remove old records.
However if the Field names need to be changed or added to etc then you need to delete the whole table using VBA code.
But if the data only changes, then you can use an Update query to update records that have changed and an Append query to add any new ones.
The control of this is by using the correct Unique ID Key field to ensure that new data is really new.
 
Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 807,865 other people just like you!

Latest posts

Staff online

Members online

Top