Solved

Command or Action 'Paste' isn't available

Posted on 2006-07-20
5
538 Views
Last Modified: 2006-11-18
I'm using Access 2003.  On a form I have a button to allow the user to copy all the fields in the current record into the next record in the dataset.  I tested the button in a copy  of the DB yesterday and it worked fine. Today, I can't get it to work in either the copy or the live DB.  The error message is:

Command or Action 'Paste' isn't available

The code is the standard button click stuff . If I use the mouse and click the Edit Menu "select record" "copy" goto next "select record" "paste" it works without an error.  It's only when I try to run it as code that the error occurs.  I have tried the DoMenuItem method and also get the same error.  The form is set to allow edits.  VB has the DAO 3.6 Library reference checked.

The user occasionally has to copy 30 plus records at a time.  Each record is an individual Sign which, while identical, must be numbered, inventoried and located. Once this is working I will try to nest it in a FOR NEXT loop so they can simply enter a number and have the routine execute that many times.
----------------------------------------
Private Sub copynext_Click()
On Error GoTo Err_copynext_Click

               RunCommand acCmdSelectRecord
               RunCommand acCmdCopy
               RunCommand acCmdRecordsGoToNext
               RunCommand acCmdSelectRecord
               RunCommand acCmdPaste

Exit_copynext_Click:
    Exit Sub

Err_copynext_Click:
    MsgBox Err.Description
    Resume Exit_copynext_Click
   
End Sub

--------------------------------------
0
Comment
Question by:Quig653
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 65

Expert Comment

by:rockiroads
ID: 17151734
Do u have unique id's in that record list? perhaps thats why?
0
 
LVL 65

Accepted Solution

by:
rockiroads earned 500 total points
ID: 17151744
Just a thought, are you wanting to create a new record?

If u have 15 records in your table, and u were on record 3, you will end up overwriting record 4
Do u need to go to the last record then paste?
0
 
LVL 1

Author Comment

by:Quig653
ID: 17153898
Thanks for asking Rocki

Yes, each record has a unique ID number and yes, I want "record 4" to be overwritten.

I preload "place holder" records so that Bar Code labels can be printed.  Because of the nature of the "paper flow" signs are produced and sent out into the field, before the information is input into the database.

As I mentioned, if you do each of those steps manually, the process works.  Access seems to understand not to try and copy the "autonumber" field.

0
 
LVL 1

Author Comment

by:Quig653
ID: 17158052
OK part of me feels foolish.

I was accessing the DB remotely at a client's location using GOTOMYPC and I was also accessing a copy of the DB on my local computer. Both databases gave me the same error message.

Today, while onsite at the client's location the subroutine worked without error.  I started thinking about it and using remote access was the only difference.  So I tested it and sure enough GOTOMYPC must take control of the Clipboard.  I not only got the error message on the remote machine, but also when running the db on local machine. As soon as I closed GOTOMYPC's session the subroutine worked.

Rocki thanks for trying...
0
 
LVL 65

Expert Comment

by:rockiroads
ID: 17159017
Hi sorry didnt respond earlier
Not using EE much at the moment, as I ill and looking for a car urgently!

Glad you sorted though and well done on figuring it out
0

Featured Post

Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…

751 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question