Results 1 to 2 of 2
  1. #1
    Rhino373 is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    May 2011
    Posts
    65

    Import only Files not already imported

    To state my overall goal, I have a directory with Excel 2007 files. These files come in daily. They are imported to an Access 2003 database during various times throughout the month. Currently a user has to remember the last file that was imported so they do not import it again.



    Here is what I am trying to do which will result in automatic import of files so users don't have to worry who imported last and where they left off.

    1. Open all .xlsx files in the given directory, save them as .csv. (This part I have done)
    2. Obtain a table with files that have already been imported (done)
    3. Have Access compare only the .csv filenames found in the given location to the table and import using the TransferSpreadSheet method only the new files then add the filename to the table. (This is where I need help. I can import all .csv files but need help comparing them to filenames in an existing table.
    4. I'll then delete all .csv files in this location so it appears nothing has changed and write the macro so all the steps occur everytime the database is opened (this I'll work on myself)

    Can anyone clue me in how to compare a filename to an existing table?

    Thanks

    Ryan

  2. #2
    ajetrumpet is offline VIP
    Windows Vista Access 2007
    Join Date
    Mar 2010
    Location
    N/A
    Posts
    2,694
    check this out: http://allenbrowne.com/ser-59.html

    that's used all over the world, I'm sure. That's an awesome piece of code. Might be useful here.

    You probably should store the file names in a table, once they've been imported. that, IMO, would be the easiest way to check whether or not it's been imported already or not. with that method, it's simply a DCOUNT() or DLOOKUP() in every iteration of the loop when you run it to import file after file.

    actually, you should be doing things like this anyway, because it's a good audit technique. Running functions and having people participate in import operations and other things without making records of what they're doing 'can' be dangerous. And of course, unproductive at times.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. How to import a mass set of xls files
    By pkstormy in forum Code Repository
    Replies: 0
    Last Post: 11-24-2010, 06:25 PM
  2. Import Text Files without access
    By 95DSM in forum Import/Export Data
    Replies: 1
    Last Post: 09-10-2010, 04:36 PM
  3. Cannot import excel or text files
    By donald_s in forum Access
    Replies: 2
    Last Post: 04-13-2010, 11:48 PM
  4. Import HTML files into access
    By mccrimmon in forum Programming
    Replies: 0
    Last Post: 02-15-2010, 03:40 PM
  5. How to import word and PDF files into Access
    By asaini in forum Import/Export Data
    Replies: 1
    Last Post: 09-03-2009, 11:11 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums