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 
VBA to click a button
Thomas Corbett 
     
3 years ago
I am trying to have a button on one form called Manager Review open another form called service list and depress a button on that form called show all. Here is my code which I am pretty sure is correct since it not that hard.

        DoCmd.OpenForm "ServicelistF"
        Forms!servicelistf!StatusCombo = 2 'Serviced
        Forms!servicelistf.UnassignedServiceCalls_Click

This is from the Security Seminar

I am getting the following error

Runtime Error - 2465
Application-defined or object-defined error

I am running Access 2016 not sure if that would affect this code though

Thanks

Tom -
Kevin Robertson  @Reply  
          
3 years ago
The click event for the Button is Private (UnassignedServiceCalls_Click).
If you make it Public the code should work however, I would recommend creating a Public Sub Routine that can be called from both places.

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/6/2026 9:14:28 PM. PLT: 1s