Quick Way to Duplicate Records

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.
 
G

Graham Mandeno

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;
 
C

Chaplain Doug

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.


.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top