john2thompson
Programmer
Hello,
I need help in creating a record in an Access table with a specific autonumber.
I need to add this specific autonumber because the record that needs to be added was formerly in the table (before being deleted by a user!) and hence has relationships with about another 20 tables elsewhere in the database.
I've tried several methods including:
-Using Append Query (using INSERT INTO) in Access
-Using Append Query in code (using <dbName>.Execute and -OpenRecordset() methods)
-Using Recordsets in code (with .AddNew & .Update)
-Detaching all relationships from the table and adding manually
-Converting autonumber to a integer and manually adding
...but to no avail!
Using the INSERT INTO queries produces Key Violation errors (even without any relations set up). When running through code, no runtime errors occur, but the ID is not added to the table.
Anyone got any other suggestions about the causes of this, and any potential solutions.
Cheers,
John
I need help in creating a record in an Access table with a specific autonumber.
I need to add this specific autonumber because the record that needs to be added was formerly in the table (before being deleted by a user!) and hence has relationships with about another 20 tables elsewhere in the database.
I've tried several methods including:
-Using Append Query (using INSERT INTO) in Access
-Using Append Query in code (using <dbName>.Execute and -OpenRecordset() methods)
-Using Recordsets in code (with .AddNew & .Update)
-Detaching all relationships from the table and adding manually
-Converting autonumber to a integer and manually adding
...but to no avail!
Using the INSERT INTO queries produces Key Violation errors (even without any relations set up). When running through code, no runtime errors occur, but the ID is not added to the table.
Anyone got any other suggestions about the causes of this, and any potential solutions.
Cheers,
John