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 
Hide a Column in a Subform
Brian Crawford 
    
4 years ago
I have a form based on a query that has many columns that are displayed in a Subform with a Data Sheet view.  Three of these subform columns are orgL1, OrgL2, and OrgL3 that represent the 3 levels of the org structure, which also have long text values.

To save space, I would like have a button on the main form to toggle hiding or displaying these columns.  I am not sure how to reference these fields on the subform from the main form so that I can set the .Visible property to False or True (Assuming that is the correct way to do this).
Brian Crawford OP  @Reply  
    
4 years ago
I see that the property I need to change is .orgL1.ColumnHidden=True, but I still don't understand how to reference the  orgL1 field on the subform from the main form.
Kevin Robertson  @Reply  
          
4 years ago
Try this, replacing with the name of your Parent Form, Subform and Field as appropriate.

With Forms!ParentFormName!SubformName.Form!FieldName
    If .ColumnHidden = True Then
            .ColumnHidden = False
        Else
            .ColumnHidden = True
        End If
End With


See Value From A Form
Brian Crawford OP  @Reply  
    
4 years ago
Thanks Kevin!  When switching between languages, it's the syntax that always trips me up.  Because the property is boolean, the toggle could just be the NOT of its current value:

With Forms!ParentFormName!SubformName.Form!FieldName
            .ColumnHidden = Not .ColumnHidden
End With

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/16/2026 11:09:27 PM. PLT: 0s