Hello...I am trying to Copy and Paste with VBA code:
DoCmd.RunCommand acCmdSelectRecord
DoCmd.RunCommand acCmdCopy
Me.AllowAdditions=True
DoCmd.RunCommand acCmdPasteAppend
Sometimes it works, but usually I get an error message "Run-time error '2046': The command or action 'Copy' isn't available now". (Sometimes the error occurs on PasteAppend.) Once this happens Access doesn't shut down properly. Even IF the database window closes, the Windows Task Manager indicates that the MSACCESS.EXE process hasn't ended. And until I end the process I can't even copy or paste in other Office applications, such as Word.
I've tried the code on other computers (a couple times) and haven't received the error.
Can anyone tell me why I'm getting this error? Is it the code, Windows, Clipboard, hardware, or what? And what can I do about it?
Any help is appreciated!
DoCmd.RunCommand acCmdSelectRecord
DoCmd.RunCommand acCmdCopy
Me.AllowAdditions=True
DoCmd.RunCommand acCmdPasteAppend
Sometimes it works, but usually I get an error message "Run-time error '2046': The command or action 'Copy' isn't available now". (Sometimes the error occurs on PasteAppend.) Once this happens Access doesn't shut down properly. Even IF the database window closes, the Windows Task Manager indicates that the MSACCESS.EXE process hasn't ended. And until I end the process I can't even copy or paste in other Office applications, such as Word.
I've tried the code on other computers (a couple times) and haven't received the error.
Can anyone tell me why I'm getting this error? Is it the code, Windows, Clipboard, hardware, or what? And what can I do about it?
Any help is appreciated!