Results 1 to 2 of 2
  1. #1
    5 Star Lounger
    Join Date
    Jan 2001
    Posts
    1,119
    Thanks
    0
    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.

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •