Copy Record within Same Table

V

vseale

I know(!), but I have a legitimate need to copy an
existing record within a table and I don't believe
openrecordset.clone or AddNew are the most efficient way
to do it. I have 90 fields and don't want to
use .AddNew. All the examples I've found use
Openrecordset.clone within a form that the user controls,
I don't see how to apply it to an automated process. The
records are programmatically pulled in when a PDA is
hotsynced. After it copies the outside file into a table,
I want to loop through it and duplicate any record that
has two fields containing values (barcode1 and/or
barcode1). The new record will then have certain fields
updated to make it unique. (I've got this part of the
code working.) Any help on this is greatly appreciated.
 
T

tina

okay, i'll resist comment... <g>

if you can write a Select query to pull the records you want to duplicate,
then turn the query into an Append query and append the record(s) back to
the same table. this won't work if the duplicate record violates a primary
key or unique index field in the table. on the other hand, depending on how
you're coming up with values to update those certain fields (that you
mentioned below) in the "new" record, you may be able to insert those values
into the new record(s) at append time - killing two birds with one stone, so
to speak.

hth
 

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