copying records

  • Thread starter Thread starter T Best
  • Start date Start date
T

T Best

Hi all,

I have a form with several subforms. With a click of a button i want to copy
the main
record and all data in the subforms that is linked to the main record.

what is the easiest way to do this?

TIA
Ted
 
Hi Ted -- What exactly would you like to accomplish? A properly normalized
db should not have duplicate data stored in tables...these usually means
there are design issues.
 
Hi Ted -- What exactly would you like to accomplish? A properly normalized
db should not have duplicate data stored in tables...these usually means
there are design issues.
 
i'm trying to duplicate the main record with all the "sub records". the
reason being...it's a policy issuance system. when the policy renews i want
to give them the ability to click a button to duplicate last years policy,
check for changes and then print.
 
i'm trying to duplicate the main record with all the "sub records". the
reason being...it's a policy issuance system. when the policy renews i want
to give them the ability to click a button to duplicate last years policy,
check for changes and then print.
 
Ted,
I have the same question as you. I have a database that contains a mail
table with 7 linked tables - which equates to a main form with 7 embedded
subforms that I wish to copy or duplicate a given record with the click of
one button. The data is entered information for a specific project. My
users will have need to up rev each project record without destroying the
previous rev. One addition to my reqauirement, is that each new duplicate add
the value of 1 to the previous key field to enable the record to be savedd as
a new record.

Al T
 
Ted,
I have the same question as you. I have a database that contains a mail
table with 7 linked tables - which equates to a main form with 7 embedded
subforms that I wish to copy or duplicate a given record with the click of
one button. The data is entered information for a specific project. My
users will have need to up rev each project record without destroying the
previous rev. One addition to my reqauirement, is that each new duplicate add
the value of 1 to the previous key field to enable the record to be savedd as
a new record.

Al T
 
You're going to have to write some code to do this. There is no simple
click-button-copy-paste-master-and-detail-records that I know of.

Your button would have to make a recordset for the top level data, add a
record, and then copy whatever fields you want in the new copy. Then, make
another recordset for the detail records and repeat the process for that
data.

You can also accomplish the same thing using a database object and writing
SQL on the fly, then using EXECUTE on the database object instead of making
recordsets. I prefer recordsets, but it depends on several factors.

Which are you comfortable with?
 
You're going to have to write some code to do this. There is no simple
click-button-copy-paste-master-and-detail-records that I know of.

Your button would have to make a recordset for the top level data, add a
record, and then copy whatever fields you want in the new copy. Then, make
another recordset for the detail records and repeat the process for that
data.

You can also accomplish the same thing using a database object and writing
SQL on the fly, then using EXECUTE on the database object instead of making
recordsets. I prefer recordsets, but it depends on several factors.

Which are you comfortable with?
 
Hi Rick, I'm more familiar with recordsets. I know what you're saying. That
was how I was leaning. I'm just a little unsure of how to do it.
 
Hi Rick, I'm more familiar with recordsets. I know what you're saying. That
was how I was leaning. I'm just a little unsure of how to do it.
 

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

Back
Top