Results 1 to 2 of 2
  1. #1
    Silver Lounger
    Join Date
    Jan 2002
    Posts
    1,615
    Thanks
    0
    Thanked 1 Time in 1 Post

    Duplicate Record Wizard with subforms (2002)

    Hi,

    I have a record with a command button to create a duplicate record on it. This was created from from a wizard as its the first time I've used it. It worked fine. My problem is that there are subforms on the form and their data needs to be duplicated as well. The code from the wizard doesn't make much sense to me so I'm not sure how to add to it to make sure that the when the user clicks the button the record that the main form is on as well as all subforms are duplicated. I will be using this same process on another form till contain a tab control and would like to know if the process will be the same.

    The code from the wizard is as follows:

    On Error GoTo Err_cmdDuplicate_Click


    DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
    DoCmd.DoMenuItem acFormBar, acEditMenu, 2, , acMenuVer70
    DoCmd.DoMenuItem acFormBar, acEditMenu, 5, , acMenuVer70 'Paste Append

    Exit_cmdDuplicate_Click:
    Exit Sub

    Err_cmdDuplicate_Click:
    MsgBox Err.Description
    Resume Exit_cmdDuplicate_Click

    Thanks,
    Leesha

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

    Re: Duplicate Record Wizard with subforms (2002)

    MSKB article ACC2000: How to Duplicate a Main Form and Its Subform Detail Records explains how to do this. You can also find an example with an extra twist in <post#=437181>post 437181</post#>.

Posting Permissions

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