Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   TechHelp   Forums   Help   Contact   Merch   Join   Order   Logon  
 
Back to Access Forum    Comments List
Upload Images   @Reply   Bookmark    Link   Email   Next Unseen 
Copy Button
Harold Laski 
    
4 years ago
I have a button on a sheet. I would like to copy that same button to the bottom of the sheet and other sheet.  However when I do it does not work. It seems that the insructions on the button do not copy and they have to be re-enterd of the new button. Is there a special way to copy a button so that it works where ever you copy it to?
Kevin Robertson  @Reply  
          
4 years ago
Hi Harold,

Are you working with Access or Excel?

As you posted in the Access Forum I will assume you meant Form, not Sheet.

What you want to do can be accomplished with an Event Handler Function

Juan C Rivera  @Reply  
             
4 years ago
I only recall that if its a macro.  If you are using VBA your best bet is copy n paste. but make sure you keep the button name the same.
Harold Laski OP  @Reply  
    
4 years ago
Yes, I am using access.      I have a button on the top of a page that says "Print report". I would like to have a button on the bottom that says the same thing but when I tried to copy the button and past it on the bottom of the FORM it does not work unless I basically redo the button.  I was trying to eliminate the extra step since I also wanted to copyh the button to multiple pages.
Kevin Yip  @Reply  
     
4 years ago
Copying and pasting a button (or any control) does not copy and paste its underlying code.  To able to truly "reuse" code somewhere else, one way is put said control on a separate form, then use it as a subform on other forms.  See pics below as an example.  My "color theme" form is dragged onto another form so its code can be used for that form.  Obviously, your code needs to be written in a way that would work with multiple forms or any form.  For instance, use the "Parent" object to refer to the parent form.
Kevin Yip  @Reply  
     
4 years ago

Dan Jackson  @Reply  
            
4 years ago
Good idea. How about setting the code as a public function?
Kevin Yip  @Reply  
     
4 years ago
Making the VBA public in such a case may not be useful, since all the procedures are likely event-driven, and they need to be run according to how that form's events play out.  At least that's how forms should be designed.  A form's code should be dictated by that form's events (hence, private procedures suffice), not from something else somewhere else out of the blue.
Harold Laski OP  @Reply  
    
4 years ago
Actually I was trying to copy the button from the top of the page to the bottom of the page so that the user can click on either button and get the same result.
Lyle Bailey  @Reply  
      
4 years ago
the buttons would need different names, IE BtnOne BtnTwo. just copy the vba code or on btntwo call BtnOne. the best way create a public function and on any button on many/any form call the function.

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

Next Unseen

 
New Feature: Comment Live View
 
 

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 2026 by Computer Learning Zone, Amicron, and Richard Rost. All Rights Reserved. Current Time: 5/8/2026 6:49:34 PM. PLT: 0s