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 
Hiding a Button
David S 
    
12 years ago
Help Please.
I have a continuous form with various fields showing together with a command button all in one line.
One of the fields is Yes/No and if it is Yes, I would like to hide the command button, whilst if it is No I would like to show the command button.
Using vba, how can I achieve that?
I believe the vba code should be an If, Else, End If statement and the relevant vba should be cmdbtnname.visible = False or True, but on which event should I insert that vba code so that when the form displays only those lines where the command button should be visible display the command button.
Many thanks


Reply from Rick Rost:

David, you really can't do this with VBA code, as surprising as it sounds. If you make the button invisible or disabled, you assign those attributes to ALL of the buttons on that form.

There is a trick where you can use an unbound text box and CONDITIONAL FORMATTING with an EXPRESSION to look at another value in the record, and then disable the text box accordingly. You can make the text box LOOK like a button and then use an OnClick event to handle what you want there.

See if that works for you. If you can't figure it out, let me know. Maybe I can include this in an upcoming video.

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/17/2026 1:52:23 AM. PLT: 1s