Welcome to SPN

Register and Join the most happening forum of Sikh community & intellectuals from around the world.

Sign Up Now!

copying records

Discussion in 'Information Technology' started by T Best, Jul 28, 2006.

  1. T Best

    T Best
    Expand Collapse
    Guest

    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
     
  2. Loading...


  3. xRoachx

    xRoachx
    Expand Collapse
    Guest

    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.

    "T Best" wrote:

    > 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
    >
    >
    >
     
  4. T Best

    T Best
    Expand Collapse
    Guest

    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.

    "xRoachx" <xRoachx@discussions.microsoft.com> wrote in message
    news:99559959-FA11-4908-A5F0-8415F290B595@microsoft.com...
    > 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.
    >
    > "T Best" wrote:
    >
    > > 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
    > >
    > >
    > >
     
  5. Al T

    Al T
    Expand Collapse
    Guest

    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

    "T Best" wrote:

    > 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.
    >
    > "xRoachx" <xRoachx@discussions.microsoft.com> wrote in message
    > news:99559959-FA11-4908-A5F0-8415F290B595@microsoft.com...
    > > 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.
    > >
    > > "T Best" wrote:
    > >
    > > > 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
    > > >
    > > >
    > > >

    >
    >
    >
     
  6. Rick Wannall

    Rick Wannall
    Expand Collapse
    Guest

    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?
     
  7. T Best

    T Best
    Expand Collapse
    Guest

    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.

    "Rick Wannall" <cwannall@yahoo.com> wrote in message
    news:vxKcg.76958$F_3.46476@newssvr29.news.prodigy.net...
    > 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?
    >
    >
     

Share This Page