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

    Intermittent Error When Pasting a Row from a Table

    I am relatively new to Access and have been receiving the following dialog box when attempting to paste a copied row from a table:



    "None of the field names you pasted onto the Clipboard match the field names on the form.
    Microsoft Office Access treats the data in the first row on the Clipboard as field names. If you copied the data from another application, the first row of data may have taken the place of the field names. Do you want to paste the field names in the order you defined with the Tab Order command?"

    From a form, I run the following code:

    DoCmd.OpenTable "DataT"
    DoCmd.ApplyFilter , "(ID = 3)"
    DoCmd.RunCommand acCmdSortAscending
    DoCmd.GoToRecord , , acLast
    DoCmd.RunCommand acCmdSelectRecord
    DoCmd.RunCommand acCmdCopy
    DoCmd.RunCommand acCmdRecordsGoToNew
    DoCmd.RunCommand acCmdSelectRecord
    DoCmd.RunCommand acCmdPaste ' *****This is the line that triggers the error******
    DoCmd.ApplyFilter "Cancel"
    DoCmd.Save
    DoCmd.Close

    The purpose of this code is to open the table, filter it according to certain criteria (which I have removed for simplicity), copy the last row, make a new row, and then paste the copied row into the new row. This code has worked flawlessly for months but as I have been updating the code and adding more features to my database, I have started getting the error. People online say that this error is called 8512 but I have never seen that number listed anywhere in the dialog box that pops up. The frustrating thing about this problem is that it only comes up every 10-15 times the code is run.

    Also, I don't know if this information is pertinent but if I press "Yes" in the dialog box that pops up (to paste the filed names in the order defined with the Tab Order command), it tries to paste the field names into the form that I have open, not into DataT, table that is open on top of the form.

    Thanks for looking at this and trying to help.

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,525
    dont paste, use an append query.

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

Similar Threads

  1. Replies: 18
    Last Post: 08-15-2016, 10:52 AM
  2. Replies: 17
    Last Post: 08-11-2016, 08:26 AM
  3. Replies: 3
    Last Post: 05-12-2015, 03:43 PM
  4. intermittent #ERROR in subform detail
    By jr2014 in forum Forms
    Replies: 7
    Last Post: 09-03-2014, 07:30 PM
  5. Error Copying & Pasting from Excel
    By kristyspdx in forum Access
    Replies: 1
    Last Post: 02-03-2012, 08:42 AM

Tags for this Thread

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