Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using dao.recordset to Copy a record with Autonumber

Status
Not open for further replies.

stburkeuk

MIS
Mar 23, 2004
27
0
0
GB
Hi,

I have a multi-user database (access 2000 with most users using XP).
Data is entered into a main table with an autonumber reference. There are then 3 nested sub tables that use this reference as part of the Key.

I currently have an SQL duplicate function in place on the main table's related form but this is tempermental and I have also been asked to allow the copying of the child records in the other tables.

I am therefore trying to use DAO.Recordset .addnew method to do this .
I have the solution, and from other posts know how to identify the new number to apply to the other tables.

However.

when I use .addnew the Autonumber feild is not generating a new and unique value and so on .update I am getting a Duplicate value error.

Anyone have any ideas on why and how to work around this.]


any Help is greatly appriciated.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top