Results 1 to 2 of 2
Thread: Import text file (2000)
2004-07-15, 10:53 #1
- Join Date
- Jan 2001
- Thanked 0 Times in 0 Posts
Import text file (2000)
I have a database that uses a table (tblgroups)where the data is refreshed monthly.
I import a text file.
I use a macro that imports the data into a new table calling it tblgroupsNew.
I rename tblgroups to tblgroupsJun (or whatever month the data represents) and rename tblgroupsNew to tblgroups.
It seems when I do it this way, the queries that use this table aren't disturbed.
My question is - Is there a better way to do this so that it is transparant to the queries that use this table. Can this be made part of my macro?
They don't want to delete the records from tblgroups and they don't want to append. They want separate tables for each refresh.
2004-07-15, 11:06 #2
- Join Date
- Mar 2002
- Thanked 28 Times in 28 Posts
Re: Import text file (2000)
The name of the tables used in a query are hard coded. The query doesn't care if it actually uses a different table each time, as long as the name is the same.
You can rename database objects in a macro - there is a Rename action. If you use VBA code instead of a macro, you can even assign names dynamically (for example using the name of the current month in the new name.