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?
LVL 1
sgleeAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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
sgleeAuthor Commented:
@mbizup
I will try that code.
0
The Five Tenets of the Most Secure Backup

Data loss can hit a business in any number of ways. In reality, companies should expect to lose data at some point. The challenge is having a plan to recover from such an event.

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:
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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
sgleeAuthor Commented:
I solved the problem by copying existing .mdb file from working workstation PC to the problem PC.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
VB Script

From novice to tech pro — start learning today.