Results 1 to 4 of 4
  1. #1
    Star Lounger
    Join Date
    May 2002
    Location
    Patagonia Region Chile
    Posts
    78
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Create copy of Master-detail Records from form (Access 2k)

    Hello.

    I am sure this has been answered but searching has yielded nothing. I have a classic master detail form. Lets say a Bill of materials. Item is the master and parts to create the item are the details. Now I have new item which is darn close to one we already make. Currently we add the item and re-input all the parts. I would like to find the similar item and once it is up on screeen... Hit a button that creates a new record for a new item and brings with it all the same parts. Then I just modify this new master detail for the few differences.

    Is there code that can do this?

    Thanks

    Jason

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Create copy of Master-detail Records from form (Access 2k)

    See Duplicate the record in form and subform on Allen Browne's website.

    Note: his code uses DAO, so you must set a reference to the Microsoft DAO 3.6 Object Library in Tools | References... in the Visual Basic Editor.

  3. #3
    Star Lounger
    Join Date
    May 2002
    Location
    Patagonia Region Chile
    Posts
    78
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Create copy of Master-detail Records from form

    Thanks Hans.

    If those forms are based queries rather than tables such as qryOrderdetail rather than Orderdetail and some of the fields on the form are based fields in that query that will not be updated by this code... Will it still work?

    EXample the code would insert the copied values for....

    ordernumber, productid, qty

    But other items on the form such as the item description gets filled in by the query on linked table products...

    Thanks

    Jason

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Create copy of Master-detail Records from form

    You'd have to tweak the code to match your situation - you want to copy only the "independent" fields. Fields that are filled in automatically don't have to be included.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •