Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   Index   Templates   Seminars   TechHelp   Forums   Help   Contact   Join   Order   Logon  
 
Home > TechHelp > Directory > Access > Calculator 7 < DoEvents | Format Currency >
Back to Calculator 7    Comments List
Upload Images   Link   Email  
Calculator 7 Copy Button
Garry Smith 
    
2 years ago
If IsNull(txtCalc) Then Exit Sub
    txtCalc.SetFocus
        DoCmd.RunCommand acCmdCopy
    Beep

Results when clicking the Copy button is

I get the error "2046':
The command or action 'Copy' isn't available now.
Kevin Yip 
     
2 years ago
Sometimes the Copy function is not available, and you will get an error if you use it in VBA.  In form view, the Copy button is greyed out on the ribbon if nothing can be copied (see picture below).  Only when there is a selected object (form, query, etc. on the navigation pane) or highlighted text can you use Copy.
Kevin Yip 
     
2 years ago

Kevin Robertson 
          
2 years ago
Garry's actually meaning the 'Copy' Button on the Calculator form.
Kevin Robertson 
          
2 years ago

Garry Smith OP 
    
2 years ago
Kevin Robertson is correct. I mean on Calculator 7 lesson.
Kevin Robertson 
          
2 years ago
Does it work in the database Richard built in the videos?
Download the sample database and compare what Richard did with your own.
Garry Smith OP 
    
2 years ago
Kevin, I am not a cold member
Kevin Yip 
     
2 years ago
But the line "DoCmd.RunCommand acCmdCopy" does rely on the Copy button on the Access ribbon being active, otherwise it returns the error you saw.  You can do a test.  Set the form's default view to "single form."  Open the form, and see whether the Access ribbon's Copy button is greyed out or not when the error occurs.

I usually avoid using "DoCmd.RunCommand acCmdCopy", because it could generate a run-time error -- while pressing Ctrl-C doesn't (SendKeys "^c").

This thread is now CLOSED. If you wish to comment, start a NEW discussion in Calculator 7.
 

 
 
 

The following is a paid advertisement
Computer Learning Zone is not responsible for any content shown or offers made by these ads.
 

Learn
 
Access - index
Excel - index
Word - index
Windows - index
PowerPoint - index
Photoshop - index
Visual Basic - index
ASP - index
Seminars
More...
Customers
 
Login
My Account
My Courses
Lost Password
Memberships
Student Databases
Change Email
Info
 
Latest News
New Releases
User Forums
Topic Glossary
Tips & Tricks
Search The Site
Code Vault
Collapse Menus
Help
 
Customer Support
Web Site Tour
FAQs
TechHelp
Consulting Services
About
 
Background
Testimonials
Jobs
Affiliate Program
Richard Rost
Free Lessons
Mailing List
PCResale.NET
Order
 
Video Tutorials
Handbooks
Memberships
Learning Connection
Idiot's Guide to Excel
Volume Discounts
Payment Info
Shipping
Terms of Sale
Contact
 
Contact Info
Support Policy
Mailing Address
Phone Number
Fax Number
Course Survey
Email Richard
[email protected]
Blog RSS Feed    YouTube Channel

LinkedIn
Copyright 2025 by Computer Learning Zone, Amicron, and Richard Rost. All Rights Reserved. Current Time: 1/25/2025 11:19:13 PM. PLT: 1s