Results 1 to 5 of 5
  1. #1
    chris.williams is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Oct 2011
    Posts
    94

    Duplicate record within table

    Hi all - I would like to duplicate a record based on the PK [ID].



    I have searched and can't seem to find an easy way to do this without specifying all fields to insert.

    I am not familiar with SQL syntax, so some code would be handy.

    Basically this is what I would hope for:

    Code:
    insert into tbl_name entire_row where id = variable

  2. #2
    recyan's Avatar
    recyan is offline Expert
    Windows 2K Access 2000
    Join Date
    Dec 2011
    Posts
    662
    Can you elaborate ?
    1) Copy existing records in Table1 in to the same table say Table1
    or
    Copy existing records in Table1 in to different table say Table2

    2) What is the role of "where", i.e. from where will the criteria for where come for ?

    Thanks

  3. #3
    chris.williams is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Oct 2011
    Posts
    94
    Copy to and from the same table. Duplicate a record.

  4. #4
    NoellaG's Avatar
    NoellaG is offline VIP
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Jun 2010
    Location
    Belgium
    Posts
    1,035
    Hi Chris,

    first of all I wonder why you would want to copy a record to the same table? Normally we normalize the database just to avoid doubles.
    But if you want to insert a copy in a new SQL database you can create a procedure with an " insert into [TABLE] select * from [TABLE] where [ID] = @variable " statement

  5. #5
    chris.williams is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Oct 2011
    Posts
    94

    Duplicate record within table

    Hi Noella. Thanks for the reply but with a PK based table that won't work since the unique PK already exists.

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

Similar Threads

  1. Goto Record when Duplicate Record Exists
    By rlsublime in forum Programming
    Replies: 13
    Last Post: 03-22-2012, 03:46 PM
  2. Replies: 5
    Last Post: 03-02-2012, 08:58 PM
  3. Duplicate last record to next record in form
    By jdhaldane in forum Forms
    Replies: 4
    Last Post: 12-17-2010, 04:22 PM
  4. If duplicate record, go to original record
    By BigBear in forum Forms
    Replies: 2
    Last Post: 10-06-2010, 02:58 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