The command or action "PasteAppend" isn't available now in ACCESS

ReferenceHi,

 I have a MS Access to duplicate current record and it is generating an error when the user clicks [Duplicate] button and I have the following VB code:

    DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
    DoCmd.DoMenuItem acFormBar, acEditMenu, 2, , acMenuVer70
    DoCmd.DoMenuItem acFormBar, acEditMenu, 5, , acMenuVer70

I am running Access 2013 on this computer. On other computers that are running ACCESS 2010, the [Duplicate] button works just fine.

 I checked the settings in reference (please see the screenshot posted) between this computer w/ Access 2013 and working computer w/ Acces 2010 and it is the same.

Fyi, I use the following code to open the database and set recordset to the table.

    Dim rst As Recordset
    Dim db As Database
           
    Set db = CurrentDb()
    Set rst = db.OpenRecordset("customer")
 

 What do I need to do to make it work?
sgleeAsked:
Who is Participating?
 
sgleeConnect With a Mentor Author Commented:
Sorry for the late reply.
I copied the database file from another user that runs the same operating system and same access version and that error message is gone.

Let me explain the lay of the land:
File Server: BackEnd.mdb file only has tables.
Workstation PC: FrontEnd,mdb resides on each PC and it file has forms, queries, VB code and linked tables to BackEnd.mdb.
Two PCs have Windows 7 and Access 2010 version and The other two PCs have Windows 10 and Access 2013 version.

The problem was occurring on one of two Windows 10 PCs w/ Access 2013. So I copied FrontEnd,mdb from working PC to non-working PC.

That solved the problem without having to change any VB code. Since all FrontEnd,mdb have the same contents, I have to believe that FrontEnd,mdb on this problem computer must have been corrupted for some reasons.
0
 
mbizupCommented:
Try replacing the DoCmd.DoMenuItem acFormBar, acEditMenu, 5, , acMenuVer70  (Paste Append) with:

DoCmd.DoMenuItem acFormBar, acEditMenu, 3, , acMenuVer70  ' Paste

Open in new window


And see if it behaves the way you want.

Or better yet, replace the wizard commands with the following for copy/pasting records (these commands are in plain English, and are not dependent on menu versions):
DoCmd.RunCommand acCmdSelectRecord
DoCmd.RunCommand acCmdCopy
DoCmd.RunCommand acCmdPaste

Open in new window

0
 
mbizupCommented:
As an aside, an error with pasting data could also indicate that the database (or record, table, etc)  is read-only, due to file permissions or various other causes,  to the particular user(s) receiving the message.
0
Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

 
sgleeAuthor Commented:
@mbizup
I will try that code.
0
 
sgleeAuthor Commented:
@mbizup
I tried both:
DoCmd.RunCommand acCmdSelectRecord
DoCmd.RunCommand acCmdCopy
DoCmd.RunCommand acCmdPaste
and
DoCmd.DoMenuItem acFormBar, acEditMenu, 3, , acMenuVer70  ' Paste

None of them worked.
0
 
mbizupCommented:
Ok - this seems to work for me (Access 2013)

DoCmd.RunCommand acCmdSelectRecord
DoCmd.RunCommand acCmdCopy
DoCmd.RunCommand acCmdPasteAppend

Open in new window


If this does NOT work for you, verify that:

1.  Your cursor is on a record in the form you are trying to run this code from.
2.  You are able to edit and add records to the form (if you can't do this manually, the code will not work as intended).
3.  The form's Allow Edits and Allow Additions properties are both set to Yes.
0
 
sgleeAuthor Commented:
I will try it and report back.
0
 
sgleeAuthor Commented:
I tried:
DoCmd.RunCommand acCmdSelectRecord
DoCmd.RunCommand acCmdCopy
DoCmd.RunCommand acCmdPasteAppend
but did not work.

1.  Your cursor is on a record in the form you are trying to run this code from. --> Yes
2.  You are able to edit and add records to the form (if you can't do this manually, the code will not work as intended). --> Yes
3.  The form's Allow Edits and Allow Additions properties are both set to Yes.  --> Yes

I manually clicked "New Record" button from navigation panel and was able to add a record that way.
0
 
PatHartmanCommented:
What line of code fails?  What is the error message?

PS - acMenuVer70 refers to the menu system of Access 95 so I'm glad mbizip is bringing you into the 21st century.
1
 
sgleeAuthor Commented:
Error@Pathartman
I have invoice main form (in blue box) and it has a few sub-forms. One of sub-forms is invoice details form that have multiple transaction records (usually one or more records that belong to invoice number). When you click [Duplicate] button within the Invoice Details/Subform, it is supposed to simply append a new record and assign saved trasaction date. But that is where it fails. Here is the code.

    Dim temp_trans_date As Date
   
    temp_trans_date = Me!Trans_Date
    DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
    DoCmd.DoMenuItem acFormBar, acEditMenu, 2, , acMenuVer70
    DoCmd.DoMenuItem acFormBar, acEditMenu, 5, , acMenuVer70 'Paste Append
    Me!Trans_Date = temp_trans_date
0
 
PatHartmanCommented:
sglee,
I cannot help you with that code.  I have no idea what items 8,2, and 3 are on the Access 95 menus.  Since MbIzip does, perhaps she can continue to help you But I suggest you use the code she offered rather than the old A95 code.
0
 
mbizupCommented:
Do you get the same error message when you run this code?  Also, you mentioned this working in earlier versions of Access.  Does this *exact* setup work for you in Access 2010, or is it the same code with a different form/different layout?

DoCmd.RunCommand acCmdSelectRecord
DoCmd.RunCommand acCmdCopy
DoCmd.RunCommand acCmdPasteAppend

Open in new window

0
 
sgleeAuthor Commented:
I solved the problem by copying existing .mdb file from working workstation PC to the problem PC.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.