Results 1 to 5 of 5
  1. #1
    VAer is offline Competent Performer
    Windows 10 Access 2013 32bit
    Join Date
    Sep 2016
    Location
    USA
    Posts
    163

    How to insert records from Excel to Access table?

    Let us say, the access table's name is Table_ABC , and I need the program to browse the excel file (*.xl*). The excel file has heading row, so the first record starts from row #2. The program should also be able to figure out how many records in the excel file, then insert(append) those records into existing table Table_ABC . FieldA, FieldB, and FieldC are field names in Table_ABC.



    Thanks.
    Attached Thumbnails Attached Thumbnails Table.JPG  

  2. #2
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,398
    use transferspreadsheet - you can set the range as A:C to import all rows from those columns, and set the 'has headings' parameter to true

  3. #3
    VAer is offline Competent Performer
    Windows 10 Access 2013 32bit
    Join Date
    Sep 2016
    Location
    USA
    Posts
    163
    Quote Originally Posted by Ajax View Post
    use transferspreadsheet - you can set the range as A:C to import all rows from those columns, and set the 'has headings' parameter to true
    How to write the code? I still need to know the code to insert those record into Table_ABC.

    Make sure each field is inserted into correct field, based on field name.

    Thanks.

  4. #4
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,398
    Providing your column headings match the field names, access will import it OK

    Your question is too broad to provide a specific answer. Google 'transferspreadsheet'. It is a common technique and you will find plenty of examples of how to use it

  5. #5
    ssanfu is offline Master of Nothing
    Windows XP Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    There are examples at Ken Snell's site http://www.accessmvp.com/KDSnell/EXCEL_MainPage.htm

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

Similar Threads

  1. Replies: 11
    Last Post: 04-27-2017, 05:16 PM
  2. Replies: 5
    Last Post: 12-01-2014, 11:31 AM
  3. Replies: 2
    Last Post: 12-20-2011, 07:33 AM
  4. Replies: 1
    Last Post: 12-28-2010, 11:24 AM
  5. Replies: 0
    Last Post: 02-24-2010, 12:56 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