Results 1 to 2 of 2
  1. #1
    KWasley is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Feb 2013
    Posts
    8

    Duplicate a record in a form including subform data

    Hi,



    I'm looking for a method to copy field data from a record in a form which includes information in a subform. I need to do this in order to allow the user to copy data from one record and then edit it lightly rather than filling in the same information over and over.

    I have searched the web to try and find an answer however I am finding it difficult to implement the coding given into my form. My subform has a primary key which is an ID (autonumber) and a foreign key which is the ID of the main form. Along with these two, there are six fields which allow multiple items to be entered displayed in the form as list boxes.

    Any help would be appreciated, thanks in advance.
    Kyle.

  2. #2
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,441
    So, this is something like a purchase order where your purchase order is for a specific customer and they order almost the same thing every time so you want to copy not only the main information on the PO but all the detail lines as well? Or do you want to selectively copy items from the subform?

    What you would likely have to do is going to involve VB script (not macros)

    The first think you'll have to do is insert a record into your 'main' table with the same information as the current record, then find the PK for that new record. Once you have that you will have to systematically insert records into your 'sub' table with the PK you just generated from the new main record. If you're using autonumbers as your PK on both tables I'd just caution you to make sure you don't have too many concurrent users to avoid any possible mishaps with PK/FK matches.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 2
    Last Post: 05-02-2012, 09:16 PM
  2. Duplicate record in Subform
    By j2curtis64 in forum Forms
    Replies: 3
    Last Post: 04-13-2011, 03:58 PM
  3. Replies: 1
    Last Post: 10-13-2010, 12:40 PM
  4. subform creates duplicate record
    By jheintz57 in forum Forms
    Replies: 0
    Last Post: 03-29-2010, 11:50 AM
  5. Replies: 0
    Last Post: 01-06-2009, 02:17 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums