Results 1 to 5 of 5
  1. #1
    delkath is offline Novice
    Windows XP Access 2003
    Join Date
    May 2010
    Posts
    4

    Question on Macro to automate file import

    I am in the process of creating some new steps and tables for my employer. I know how to create an excel import macro, but before I tackle that I am curious to know; Once I have my table created with example columns; Vendor, Account, Cust, Cost, Address etc etc.. I go and create my MSAccess macro to import an excel file to that table. Does the excel file have to have the same column layout as the table, or will simply having the excel Column Names being identical to the Access Column names be enough to tell Access which column should go where?



    Hope that made sense

  2. #2
    Join Date
    May 2010
    Posts
    339
    Quote Originally Posted by delkath View Post
    Does the excel file have to have the same column layout as the table, or will simply having the excel Column Names being identical to the Access Column names be enough to tell Access which column should go where?

    Hope that made sense
    Layout is not important in the excel. If you match the column heads in your excel file, with the field names in your table the import will go through.

  3. #3
    Datagopherdan is offline Competent Performer
    Windows 7 Access 2007
    Join Date
    Dec 2008
    Posts
    220
    One of the things that you want to look out for with an Excel import is the data types. Whatever the first line of data's format is in the spreadsheet, that's what Access will use for the data format. It's always best to import to a temp table and then append the data to a formatted table.

    Quote Originally Posted by delkath View Post
    I am in the process of creating some new steps and tables for my employer. I know how to create an excel import macro, but before I tackle that I am curious to know; Once I have my table created with example columns; Vendor, Account, Cust, Cost, Address etc etc.. I go and create my MSAccess macro to import an excel file to that table. Does the excel file have to have the same column layout as the table, or will simply having the excel Column Names being identical to the Access Column names be enough to tell Access which column should go where?

    Hope that made sense

  4. #4
    delkath is offline Novice
    Windows XP Access 2003
    Join Date
    May 2010
    Posts
    4

    thanks!

    worked like a charm. thank you!

  5. #5
    Datagopherdan is offline Competent Performer
    Windows 7 Access 2007
    Join Date
    Dec 2008
    Posts
    220
    Glad you got it working.

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

Similar Threads

  1. Import text file question
    By sumdumgai in forum Import/Export Data
    Replies: 14
    Last Post: 03-23-2010, 07:59 AM
  2. Macro To Import CSV to ACCESS
    By csvivek in forum Import/Export Data
    Replies: 1
    Last Post: 12-07-2009, 01:49 PM
  3. import using Macro
    By johnny1g in forum Import/Export Data
    Replies: 1
    Last Post: 09-15-2009, 04:21 AM
  4. Automate Excel Import to Access Related Tables
    By KramerJ in forum Programming
    Replies: 6
    Last Post: 04-04-2009, 04:24 PM
  5. CSV File Import
    By compasst in forum Import/Export Data
    Replies: 3
    Last Post: 03-31-2006, 09:37 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