Quick Way to Duplicate Records

  • Thread starter Thread starter Chaplain Doug
  • Start date Start date
C

Chaplain Doug

I have a table with some records selected by a check filed
called (SELECTED). What would be a quick way
programmatically to duplicate these records, where some of
the fields are copied as is, one field is changed, and the
rest of the fields are left uninitialized? It does not
appear that I can do all of this with an Append Query.
Thanks for the help.
 
Yes, you can do this with an append query. It will look something like
this:

Insert into MyTable (SameField1, SameField2, NewField1)
Select SameField1, SameField2, NewValue as NewField1
from MyTable where Selected<>0;

You would probably want to follow it up with:

Update MyTable set Selected=0 where Selected<>0;
 
Thanks Graham. Looks like it works. God bless.
-----Original Message-----
Yes, you can do this with an append query. It will look something like
this:

Insert into MyTable (SameField1, SameField2, NewField1)
Select SameField1, SameField2, NewValue as NewField1
from MyTable where Selected<>0;

You would probably want to follow it up with:

Update MyTable set Selected=0 where Selected<>0;

--
Good Luck!

Graham Mandeno [Access MVP]
Auckland, New Zealand



I have a table with some records selected by a check filed
called (SELECTED). What would be a quick way
programmatically to duplicate these records, where some of
the fields are copied as is, one field is changed, and the
rest of the fields are left uninitialized? It does not
appear that I can do all of this with an Append Query.
Thanks for the help.


.
 
Back
Top