Results 1 to 3 of 3
  1. #1
    David Cristallo
    Guest

    Appending a new record to Access table from Excel

    Hi there,

    Here is my problem: I have to append a new record in an Access table from Excel (VBA) AND I need to retrieve the internal ID that has been allocated to the new record in Excel. Shoul I use the AddNew method (which implies that I need to populate a RecordSet object with the content of the Access table I modify) or should I use a INSERT INTO action query followed by a SELECT query (to retrieve the added record as well as its ID) or is there a better technique ?

    TIA,
    David
    Access97 under Windows NT4

  2. #2
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Appending a new record to Access table from Excel

    Sorry, David, but I'm not clear on what you're asking. Does this
    <hr>I need to retrieve the internal ID that has been allocated to the new record in Excel<hr>
    mean that you want to get the primary key from the new Access record and pass it back to Excel or something else?

    Maybe if you explain what you're trying to accomplish rather than just what you want to do, it will be clearer. You want to append a record from Excel into Access. To what purpose? If you're using Excel as a front end to Access, you can link the Access table to Excel.
    Charlotte

  3. #3
    David Cristallo
    Guest

    Re: Appending a new record to Access table from Excel

    Sorry if I was not clear Charlotte,

    Yes I want to append a record in an Access table and get the primary key for this new record back to Excel. What is the good technique to achieve this using DAO?

    TIA,
    David

Posting Permissions

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