Results 1 to 3 of 3
  1. #1
    Join Date
    Mar 2009
    Posts
    1

    Unanswered: Code for appending data to an existing access table from excel

    Dear All,
    I need help on how to wite the code in access form to append data in an existing access table from a specific sheet of an excel file.

    Let me add I am not a I.T. Professional , so please help by giving answer in detail i.e. code in detail.

    Thanks and warm regards

    Habib Fakhruddin
    habibfakhruddin@hotmail.com

  2. #2
    Join Date
    Mar 2009
    Posts
    5,442
    Provided Answers: 14
    Use the TransferSpreadsheet method of the DoCmd object, like this:
    Code:
    DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel<x> , <Table name>, <File name>, True/False, <Range>
    See online help or MS Access documentation for the meaning of the different parameters. Depending of the version of Access and Excel that are in use, some differences might exist in the parameters.

    You could also use an ADO object to create a link to the Excel file but it's more complicated.

    Have a nice day

  3. #3
    Join Date
    Jun 2003
    Location
    USA
    Posts
    1,032
    Or perhaps could do File | Get External Data | Link Tables to link to the table in the Excel file. And then you could have code behind the form run an append query based on the Excel table that writes to the Access table.
    J. Paul Schmidt, Freelance Web and Database Developer
    www.Bullschmidt.com
    Access Database Sample, Web Database Sample, ASP Design Tips

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •