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.