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 
Use a Form as Subform
Juan C Rivera 
            
4 years ago
Good morning team,
I got a thought and looking for ideas as to how to make it work.  Most likely it's very easy, I just got a senior moment right now.  I have a form that I like to use as a subform also.  when I use it as a subform I like to make the buttons on the from visable = false.  When not a used as a sub form visable = true.  How is this called out in VBA and where is it placed? In the past I just made two forms but now I'm looking to make my code smaller and clean.  Any thoughts out there?

V/r
Juan
LLNP
Kevin Robertson  @Reply  
          
4 years ago
You could control the visibility of the buttons when the form opens in the button that open the form.

You could also try this code.

Private Property Get HasParent() As Boolean

    On Error Resume Next
    HasParent = TypeName(Me.Parent.Name) = "String"
    Exit Property

End Property

Private Sub Form_Load()

    If HasParent Then
        Button1.Visible = False
        Button2.Visible = False
    Else
        Button1.Visible = True
        Button2.Visible = True
    End If
    
End Sub
Juan C Rivera OP  @Reply  
            
4 years ago
Big thanks I will give this a try when I get home tonight.

Big Thanks
Juan

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/9/2026 6:17:02 AM. PLT: 1s