Copy records with a new AutoNumber

Maldrid

Registered User.
Local time
Today, 21:00
Joined
Jul 24, 2003
Messages
20
Copy records with a new AutoNumber [Resolved]

I am trying to do the following statement

Code:
sSQLQuery = "INSERT INTO Test SELECT * FROM Test WHERE [Flight #] = 'LOUNGE'"

    
    cn.Execute sSQLQuery

This will basicially make a copy of the records that have a flight number of Lounge. The problem is that there is a primary key DataID which is an autonumber. If I use this statement, it will give me a message about the duplicate records. Is there a way to make a copy of the records but having access create new numbers for the copied records? Or will have to do this using two recordsets and create the autonumber msyelf?
 
Last edited:
Code:
sSQLQuery = "INSERT INTO Test SELECT [COLOR=red][List only the fields that you want to come over][/COLOR]  FROM Test WHERE [Flight #] = 'LOUNGE'"
    
    cn.Execute sSQLQuery
 
Thanks. That is what I thought I would have to do, I just didn't want to type all the fields since it was like 50 hehe. Oh well thanks!
 
This is a program that I am working on and that is what I need to do once the user does certain selections from my screen. It is something that I want a user doing manually like you mentioned.
 

Users who are viewing this thread

Back
Top Bottom