Results 1 to 5 of 5
  1. #1
    StuartSmith is offline Novice
    Windows XP Access 2007
    Join Date
    Oct 2010
    Posts
    3

    Custom Import from Excel


    I am looking for some help with the following. I want to have the user select an excel file to import, once selected, the column headings in the excel sheet are displayed with ability to map each column to the correct column in an existing table in the access database. Then clicking ok would import the selected excel sheet into the appropriate columns in the access table.

    My thought would be to import the excel sheet using transferspreadsheet and use the tabledef to get all the field names from the excel sheet and the destination table (destination fields in drop down) then run insert statement using the mapping.

    Any advice on the best approach would be appreciated.

  2. #2
    weekend00 is offline I may not be right
    Windows XP Access 2003
    Join Date
    Aug 2010
    Posts
    1,295
    1 change you table field name to match the title in Excel sheet; or
    2 import into a temporary table using fieldname as Excel sheet then append to the target table by a query.

    Coding is the most complicated way and i think it should be the last choice.

  3. #3
    StuartSmith is offline Novice
    Windows XP Access 2007
    Join Date
    Oct 2010
    Posts
    3
    Unfortunately, this is a process the a user with not much access experience is going to be doing so having them import then open query designer to append the data is not going to work. Also the format of the excel is not static, fields are in different columns which is why I wanted to have a mapping function.

  4. #4
    StuartSmith is offline Novice
    Windows XP Access 2007
    Join Date
    Oct 2010
    Posts
    3
    The current way I do it is to have them copy the excel sheet into a template excel sheet with the proper column names and order then I import that one using transfer spreadsheet. We are looking to eliminate that step with a simple mapping process.

  5. #5
    weekend00 is offline I may not be right
    Windows XP Access 2003
    Join Date
    Aug 2010
    Posts
    1,295
    My thought would be to import the excel sheet using transferspreadsheet and use the tabledef to get all the field names from the excel sheet and the destination table (destination fields in drop down) then run insert statement using the mapping.
    You thought is good to go.

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

Similar Threads

  1. Custom import macro
    By sliminconcoova in forum Import/Export Data
    Replies: 26
    Last Post: 09-15-2010, 10:44 AM
  2. Exporting to a custom Excel template
    By theronlightfoot in forum Import/Export Data
    Replies: 2
    Last Post: 04-12-2010, 11:51 PM
  3. VBA to open excel, import on close of excel
    By bdaniel in forum Programming
    Replies: 0
    Last Post: 03-20-2010, 02:45 PM
  4. import custom form data from Outlook
    By bigsteve520 in forum Import/Export Data
    Replies: 0
    Last Post: 11-13-2009, 12:18 PM
  5. Custom Import Tool
    By naoumaro in forum Import/Export Data
    Replies: 0
    Last Post: 04-10-2009, 08:30 PM

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