Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2003

    Question Unanswered: Retain AutoNumber's Random setting after TransferDatabase command in VBA


    I have an Access 2000 database that requires me to export subsets of it, and add, or change records in the subset via a standalone program that links to the exported database. These changes must be imported back into the main database. To avoid stomping on existing records (because there may be multiple users of different subsets of the data at any time), I've set up AutoNumber fields as primary keys, and the AutoNumber is set to random. However, when the TransferDatabase command is run from VBA in the export routine, the resulting tables in the exported database have their AutoNumbers set to Increment.

    How can I either keep this from happening when I export the tables to the outside database, or reset the AutoNumbers to random when I link to the tables via the standalone (this has to be done via VBA code, because the end users will not be able to cope with doing it themselves).



  2. #2
    Join Date
    Oct 2003
    I may be missing something, but I would change the autonumber field in the exported database to a number field and update the main database with an update query. If the user added records, then just import those with an append query and let the database renumber them.

    Or are you trying to retain the numbers from the exported database when they are sent to the main database?

Posting Permissions

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