Results 1 to 12 of 12
  1. #1
    mrwistles is offline Novice
    Windows Vista Access 2003
    Join Date
    Aug 2010
    Posts
    18

    Importing to the same table daily


    Hi there, great forum you have here. Quick question in regards to auto importing.

    I import from an excel file every day where the columns and headers stay the same. What I want to do is import into the same table but just had a date for when the item was added. e.g I have fields 1-8 and everyday I want the import to feed the same table, keep the existing information but have the date it was imported as another column in field 9.

    How do I do this?

    Thanks for your time.

  2. #2
    ajetrumpet is offline VIP
    Windows Vista Access 2007
    Join Date
    Mar 2010
    Location
    N/A
    Posts
    2,694
    I think it might be easier if you came up with a method of using the TODAY() function in excel in the last column and simply imported everything into access using code or the wizard in one fell swoop. That way, the date is already there and you can avoid any code that is necessary to do this with.

  3. #3
    mrwistles is offline Novice
    Windows Vista Access 2003
    Join Date
    Aug 2010
    Posts
    18
    Thanks.

    I am importing from about 1,000 different spreadsheets. So to use the today formula I would have to change multiple sheets going forward.

    That is obviously a mammoth task and something which I would like to avoid.

  4. #4
    ajetrumpet is offline VIP
    Windows Vista Access 2007
    Join Date
    Mar 2010
    Location
    N/A
    Posts
    2,694
    Quote Originally Posted by mrwistles View Post
    That is obviously a mammoth task and something which I would like to avoid.
    actually it's not that 'mammoth' for code to run on it but it might take a few minutes.

    but maybe there's an easier way in access:

    *add a date field to your table
    *import your 1,000 ss data as appended data to the table
    *when you get done with that, run an UPDATE QUERY on your table and replace all NULL values in the date field with the function DATE()

  5. #5
    weekend00 is offline I may not be right
    Windows XP Access 2003
    Join Date
    Aug 2010
    Posts
    1,295
    Just add one DataTime field in you table, set it's default to now() if you don't mind the time. if you don't want the time, use int(now) as default.

    every time you add new record, the default value will be insert to the field. you don't need any code for it.

  6. #6
    ajetrumpet is offline VIP
    Windows Vista Access 2007
    Join Date
    Mar 2010
    Location
    N/A
    Posts
    2,694
    Quote Originally Posted by weekend00 View Post
    Just add one DataTime field in you table, set it's default to now() if you don't mind the time. if you don't want the time, use int(now) as default.

    every time you add new record, the default value will be insert to the field. you don't need any code for it.
    That's so funny. Very good solution weekend. I absolutely love it!

  7. #7
    pkstormy's Avatar
    pkstormy is offline Access/SQL Server Expert
    Windows XP Access 2003
    Join Date
    Mar 2010
    Location
    Madison
    Posts
    682

    Import XLS Files

    Here's a nice import form I designed to import 1 or multiple xls files in a designated folder the user selects on the form (using the Browse button).

    Once the browse button is clicked and the import folder is supplied, and then the import button is clicked, it can cycle through the entire folder importing all and any xls files.

    Hope it helps.

  8. #8
    mrwistles is offline Novice
    Windows Vista Access 2003
    Join Date
    Aug 2010
    Posts
    18
    Thanks all. Will check these out later. Much appreciated.

  9. #9
    weekend00 is offline I may not be right
    Windows XP Access 2003
    Join Date
    Aug 2010
    Posts
    1,295
    Quote Originally Posted by ajetrumpet View Post
    That's so funny. Very good solution weekend. I absolutely love it!
    Thanks Aje.

  10. #10
    pkstormy's Avatar
    pkstormy is offline Access/SQL Server Expert
    Windows XP Access 2003
    Join Date
    Mar 2010
    Location
    Madison
    Posts
    682
    Quote Originally Posted by weekend00 View Post
    Just add one DataTime field in you table, set it's default to now() if you don't mind the time. if you don't want the time, use int(now) as default.

    every time you add new record, the default value will be insert to the field. you don't need any code for it.
    Or you can simply set the defaultvalue to =Date() and you won't get the time.

  11. #11
    pkstormy's Avatar
    pkstormy is offline Access/SQL Server Expert
    Windows XP Access 2003
    Join Date
    Mar 2010
    Location
    Madison
    Posts
    682
    Quote Originally Posted by pkstormy View Post
    Here's a nice import form I designed to import 1 or multiple xls files in a designated folder the user selects on the form (using the Browse button).

    Once the browse button is clicked and the import folder is supplied, and then the import button is clicked, it can cycle through the entire folder importing all and any xls files.

    Hope it helps.
    I forgot to mention, this also keeps a log history of the excel files imported and when they were imported.

  12. #12
    fatalmusic is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Apr 2011
    Posts
    2
    Quote Originally Posted by pkstormy View Post
    Here's a nice import form I designed to import 1 or multiple xls files in a designated folder the user selects on the form (using the Browse button).

    Once the browse button is clicked and the import folder is supplied, and then the import button is clicked, it can cycle through the entire folder importing all and any xls files.

    Hope it helps.

    I tried using your test form, but i get an error after confirming the import from the folder i browsed to:

    "You entered an expression that has an invalid reference to the property FileSearch"

    Then this gets highlighted in the Importing Module after clicking 'debug':

    Code:
    Dim NumFound As Long
            With Application.FileSearch
            .NewSearch
            .LookIn = Directory
            .FileName = FileSpec
            If .Execute() > 0 Then
    any idea how to solve this? I'm using Access 2007.

    Thanks a lot

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

Similar Threads

  1. Need help in importing table
    By sdondeti in forum Access
    Replies: 6
    Last Post: 11-16-2009, 09:38 AM
  2. Importing text file into Access Table
    By Anthony in forum Import/Export Data
    Replies: 13
    Last Post: 09-23-2009, 04:47 PM
  3. HELP!!! - Importing table decimal field truncating
    By Valeda in forum Import/Export Data
    Replies: 0
    Last Post: 12-05-2006, 04:06 PM
  4. Importing a tab delimited file into access table - please he
    By championss in forum Import/Export Data
    Replies: 0
    Last Post: 10-29-2006, 02:33 AM
  5. Importing a table created in word to Access
    By anthony_f_justin in forum Access
    Replies: 4
    Last Post: 01-04-2006, 09:06 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