Results 1 to 3 of 3
  1. #1
    Join Date
    Jun 2009
    Posts
    2

    Unanswered: Exporting data to Access using VB

    Hi

    I'm trying to find a way of exporting data from an excel spreadsheet into an access database using VB code. I've already extracted data from Access into Excel, but that appears to have been the easy bit.

    What I need is either pointing in the direction of some kind of guide, or help in writing a bit of code that allows me to open an access table, delete any records, then update it with the data from the excel spreadsheet (which is already formatted correctly).

    Any help would be much appreciated!

  2. #2
    Join Date
    Sep 2006
    Location
    Surrey, UK
    Posts
    994
    Provided Answers: 2
    Is this going to be run from Access or Excel?

    Either way, you need to create and run a DELETE SQL statement against the destination table. Once that's done, you then execute a DoCmd.TransferSpreadsheet statement using the Excel file as the filename and the table as the table name.

  3. #3
    Join Date
    Jun 2009
    Posts
    2
    It's going to be run from Excel

    Are there any examples of those? I'm having to use excel/access 2003, and I've found some bits on 2007 but they don't work in my version. I'm also a little new to intergrating these two together, but other people are making a batallion of mistakes, so I wanted to make it so they couldn't!

Posting Permissions

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