Create Duplicate Record

steve_4477

Registered User.
Local time
Today, 06:03
Joined
Jan 10, 2011
Messages
23
SQL Buffs,

Is there a way I can copy a record line from a table and paste it in the same table with a new 'autonumber' ID? Manually, its a fairy easy task. I would think there should be a fairly simple SQL statement to accomplish this without have to copy individual fields. Thoughts?

Steve
 
Steve,
are you working in an .mdb? Are you looking for a simple query to copy a row into the same table? If so... just create a query where the PK parameter is pointing at the row you want to copy. Then Add all fields EXCEPT for the PK. Make it an append query that is appending to the same table.
that should be all you need.
hth,
..bob
 
Thanks, it does....

I had actually just stumbled on to the 'Append Query' and was going in the direction that you are advising. Now I'm trying to figure out how to point the 'PK' parameter to a specific row; I am assuming PK is what you are calling my auto-number field. Normally I would simply set the criteria to equal the indicated field within the form i.e. =[Forms]![FRM_SearchMulti]![HiddenFacID]. But how do I do this if the field is not in the append query? Does that make sense?
 
Nm, think I just ansered my own question.... just needed to play with it for a minute.

Thanks again!
 

Users who are viewing this thread

Back
Top Bottom