PC Review


Reply
Thread Tools Rate Thread

'copy' isn't available now - just occurred, was OK

 
 
Mick Ruthven
Guest
Posts: n/a
 
      27th Jan 2006
I have an Access 2002 application that's been running for years. One feature
is a button on a form that copies the string contents of a control to the
clipboard. This morning it stopped working and gives this instead:

Run-time error '2046' - The command or action 'Copy' isn't available now.

Here is the code. It stopped on the "acCmdCopy" line. CtrlName is a variable
that contains the name of the control (I checked and it does contain it),
and the control contains the string to be copied (I checked that too). I
also tried "DoCmd.DoMenuItem A_FORMBAR, A_EDITMENU, A_COPY" and got the same
error.

DoCmd.GoToControl CtrlName
DoCmd.RunCommand acCmdCopy

Any ideas? This function has worked for years, including just a few days
ago, and I've not changed anything regarding Access other than creating a
new Access Project using SQL Server, but that should have nothing to do with
this standalone Access app. It's on a Win XP SP1 system.

Thanks,

Mick Ruthven


 
Reply With Quote
 
 
 
 
Mick Ruthven
Guest
Posts: n/a
 
      28th Jan 2006
I created the problem myself. I had changed the "Behavior entering field"
keyboard option in Access from "Select entire field" to "Go to start of
field". The DoCmd.RunCommand acCmdCopy depends on the text in the control
being selected, and the prior DoCmd.GoToControl CtrlName was going to the
control but not selecting the text. I set that option back to "Select
entire field" and it works fine. I do need to find a more robust method that
doesn't depend on that option being set a certain way. I found a page that
says it does just that. http://www.mvps.org/access/api/api0049.htm



 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Copy local users and groups, copy shares with security, copy homeuser folders usenet@sphere10.com Microsoft Windows 2000 Active Directory 1 17th Feb 2009 01:31 PM
Copy local users and groups, copy shares with security, copy homeuser folders usenet@sphere10.com Windows Vista General Discussion 2 17th Feb 2009 01:31 PM
What occurred? itsme General Discussion 4 19th Sep 2006 07:38 AM
"An error occurred attempting to create the Object Picker. An error with no description has occurred." JimMarkgraf Windows XP Security 0 13th Dec 2005 08:23 PM
Gateway Timeout The following error occurred: [code=DNS_TIMEOUT] A DNS lookup error occurred because the request timed out during the lookup. Jim Microsoft Windows 2000 DNS 3 24th Oct 2003 04:14 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:23 AM.