Results 1 to 4 of 4
  1. #1
    raychow22 is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    May 2017
    Posts
    145

    Duplicate Button

    Hi Forum,

    All of a sudden my duplicate button is no longer working... the code for it is displayed and also a picture of error:

    Private Sub cmdDup_Click()



    On Error GoTo Err_cmdDup_Click


    DoCmd.RunCommand acCmdSelectRecord
    DoCmd.RunCommand acCmdCopy
    DoCmd.RunCommand acCmdRecordsGoToNew
    DoCmd.RunCommand acCmdSelectRecord
    DoCmd.RunCommand acCmdPaste

    Me.MRRNumber = Nz(DMax("[MRRNumber]", "tblMaterialsList"), 0) + 1

    Me.Inspection_Date = Date

    Exit_cmdDup_Click:
    Exit Sub

    Err_cmdDup_Click:
    MsgBox Err.Description
    Resume Exit_cmdDup_Click


    End Sub

    Click image for larger version. 

Name:	1.png 
Views:	17 
Size:	71.6 KB 
ID:	30011

  2. #2
    davegri's Avatar
    davegri is offline Excess Access
    Windows 10 Access 2016
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,389
    Maybe because the form is blank and there's nothing to copy?

  3. #3
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,398
    if you have not made any changes - recommend you take a look at this thread - you may have had the same update

    https://www.accessforums.net/showthread.php?t=67433

    It seems to be affecting quite a variety of things.

    looks like you have exactly the same code has this guy

    https://access-programmers.co.uk/for...d.php?t=196052

    also suggest try compact and repair - and check your library references

  4. #4
    Micron is offline Virtually Inert Person
    Windows 7 32bit Access 2007
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,737
    If the above suggestions don't help, I would look for a different way. This old method is for copying data to the clipboard, which as I understand it, is becoming more flaky in later OS'. Kind of like how SendKeys has fallen out of favour. If that doesn't sound attractive, you can try integrating API calls to get at the clipboard. AFAIC, something like this would be easier than API calls.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

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

Similar Threads

  1. Trouble with duplicate button
    By lovelykid23 in forum Access
    Replies: 4
    Last Post: 03-09-2017, 01:35 PM
  2. Print & Duplicate button
    By BUTTONBASHER in forum Access
    Replies: 1
    Last Post: 01-18-2016, 08:59 AM
  3. Replies: 3
    Last Post: 03-19-2013, 04:09 AM
  4. Button to duplicate part of record
    By jbickl in forum Forms
    Replies: 3
    Last Post: 02-08-2012, 10:44 PM
  5. Duplicate command button
    By brettg in forum Database Design
    Replies: 1
    Last Post: 08-04-2008, 04:16 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