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 
Combo to Make SubF Visible
Marc Spragg 
     
4 years ago
Hi,
I have a mainform with two subforms. In the mainform i have a combo box (POType) that i want - based on the selection in the combo - to display one of the subforms plus a command button.
The combo is unbound. If the combo is null then, neither subforms or the button should be visible. If you select "Blanket PO" or "Fisher Portal" from the combo i want subform 2 to be visible and subf 1 and button not visible and if you choose the other selections i want the button and subF 1 to be visible but subf2 not visible. I've tried different approaches using IF, then, else (Both the same in on current and after update for the combo) and also a case statement in the after update for the combo. I can't get anything to work. Can anybody help?
Marc Spragg OP  @Reply  
     
4 years ago

Marc Spragg OP  @Reply  
     
4 years ago

Marc Spragg OP  @Reply  
     
4 years ago

Marc Spragg OP  @Reply  
     
4 years ago

Marc Spragg OP  @Reply  
     
4 years ago

Kevin Robertson  @Reply  
          
4 years ago
To make a Subform Object visible/not visible you don't need .Form.
You can just say SubformName.Visible = False.
John Davy  @Reply  
          
4 years ago
Hi Marc
I just made a small demo for you. My question is - If you use a table with an autonumber you will never have a null. What do you have for data in your combo box?

John
Kevin Robertson  @Reply  
          
4 years ago
The Combo Box could have a Null value if there is no item selected or it has been cleared.
Marc Spragg OP  @Reply  
     
4 years ago
Thanks John, the combo was set up using the wizard with column 0 as PK Autonumber and Description Column 2. I then removed the control source to make it unbound. Attached screenshot. Kevins right, the null is to capture when the Combo is unselected or has been cleared. I don't want either subform to display until the user decides which route to take and selects the option from the combo. If they change their mind then i need the form to switch to the other choice. I corrected the If statements to SubformName.Visible = False but still cannot get it to behave as required. Again i fiddled and fiddled with the statement. Do you guys think that a loop is required? I have only looped once before and Scott helped me with code. It was by a while loop on a recordset but with this particuar scenario i don't see how i can use a recordset as its unbound and im only trying to display forms.
Marc Spragg OP  @Reply  
     
4 years ago

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 12:39:37 PM. PLT: 1s