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 Developer Forum    Comments List
Upload Images   @Reply   Bookmark    Link   Email   Next Unseen 
Form!SubForm
Teri Bridges 
    
4 years ago
I have a Main Form with a sub form. I would like to have a command button that would when clicked show/Hide the sub form.
I tried this but it did not work, I get an error.
'Hide It
Forms!frmCourseDetails!frmCourseReviewCycleSubform.Visible = False

'Show it
Forms!frmCourseDetails!frmCourseReviewCycleSubform.Visible = True
Teri Bridges OP  @Reply  
    
4 years ago
Then I tried a couple of others. Boy just when I think I am understanding something. I go and mess it all up.

with Me.frmCourseReviewCycleSubform
    .visible=not .visible
    .caption=iif(.Visible,"Hide Subform","Show subform")
end with


Me.frmCourseReviewCycleSubform.Visible =not Me.frmCourseReviewCycleSubform.Visible
Kevin Robertson  @Reply  
          
4 years ago
Try this

If frmCourseReviewCycleSubform.Visible Then
    frmCourseReviewCycleSubform.Visible = False
Else
    frmCourseReviewCycleSubform.Visible = True
End If
Teri Bridges OP  @Reply  
    
4 years ago
Thanks for the fast reply but I must be making a mistake somewhere. That code did not work either
Teri Bridges OP  @Reply  
    
4 years ago

Teri Bridges OP  @Reply  
    
4 years ago
I tried to research this error but not sure what I need to check or declare

Search results for error= You used an Option Explicit statement to require the explicit declaration of variables, but you used a variable without declaring it. Explicitly declare the variable, or change the spelling of the variable to match that of the intended variable.
Kevin Robertson  @Reply  
          
4 years ago
Check the name of your Subform object.
Teri Bridges OP  @Reply  
    
4 years ago
I did and it was right. But what I ended up just doing was removing the subform and adding it back and not it works. How very odd. Thank you for the help!
Kevin Robertson  @Reply  
          
4 years ago
Your welcome. Glad you got it working.

This thread is now CLOSED. If you wish to comment, start a NEW discussion in Access Developer 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 11:59:55 AM. PLT: 1s