Results 1 to 5 of 5
  1. #1
    lovelykid23 is offline Novice
    Windows 8 Access 2013 64bit
    Join Date
    Feb 2017
    Posts
    5

    Unhappy Trouble with duplicate button

    I have some trouble with the Duplicate button and really needs help.

    I created a form to input record. Many time, when I have big orders, they are similar to each other with some little differences. So I created a Duplicate button, using the default button in Access.
    The button works fine if I created only a few duplication at once. However, when I created a large order, (i.e. duplicating 30 records at once), sometimes in the table, it appears as only 29 records, sometimes it appears as 30 records. When I closed down Access and opened it again the next day and checked the table, there were more than 30 records. It was very random. Sometimes it doubled the number of records, sometimes it added a few extra records.
    I don't know what to do. Should I build another Duplicate button? I don't know how to.

    If you know, please help.

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,525
    what exactly does the duplicate button do? a query? code?
    if you want to duplicate 1 record, then provide the key in the query.

  3. #3
    lovelykid23 is offline Novice
    Windows 8 Access 2013 64bit
    Join Date
    Feb 2017
    Posts
    5
    I want to duplicate a record. Would you mind explaining further about having to 'provide the key in the query'?

  4. #4
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,525
    The record you want to copy SHOULD have a key in the table. (I hope your table has keys)
    the append query would use this as the where clause.
    select * from table where [id]=forms!myForm!txtKey

    if your table has no key, then use fields on the record to make it unique so you don't copy several records.

  5. #5
    lovelykid23 is offline Novice
    Windows 8 Access 2013 64bit
    Join Date
    Feb 2017
    Posts
    5
    I created a form and add a Duplicate button. When I fill out the form and press the Duplicate button, the whole record that I just filled out in the form will duplicate itself. I attached a picture of the macro code I used for the button.
    The problem is when I used this button to duplicate the record, it works fine if I only duplicated a few records. When I duplicated quite a few (like 30), then sometimes there were less than 30 records, sometimes there were more than 30. It's not consistent. Did I do something wrong with the code for the button?




    Click image for larger version. 

Name:	Capture.PNG 
Views:	8 
Size:	15.2 KB 
ID:	27797

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

Similar Threads

  1. Print & Duplicate button
    By BUTTONBASHER in forum Access
    Replies: 1
    Last Post: 01-18-2016, 08:59 AM
  2. Replies: 11
    Last Post: 10-15-2014, 07:38 PM
  3. Replies: 1
    Last Post: 05-23-2013, 10:00 AM
  4. Replies: 2
    Last Post: 06-26-2012, 10:54 PM
  5. Replies: 1
    Last Post: 07-15-2011, 05:24 AM

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