?
Solved

Hiding a subform with a multiple column listbox

Posted on 2008-09-30
6
Medium Priority
?
362 Views
Last Modified: 2013-11-28
I want to hide my subform based on the choice in a multiple column list box.

My list box has two headings Name and Number
based on the name selected i want to use a select case statement to hide or unhide the subform.
0
Comment
Question by:atreidies
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
6 Comments
 
LVL 30

Expert Comment

by:hnasr
ID: 22606937
If the control that contains the subform is calld x, then in the listbox after update hide/unhide the control

    Me!x.Visible = False
0
 
LVL 1

Author Comment

by:atreidies
ID: 22607042
I know the statement to hide it, what i dont know is how to make that happen based on which record is selected. I mean to use a select statment to hide or unhide it.
0
 
LVL 30

Expert Comment

by:hnasr
ID: 22607087
<I mean to use a select statment to hide or unhide it.>
Can you explain more?
A select statement won't hide the control!
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 1

Author Comment

by:atreidies
ID: 22607255
my list box has 2 columns
what I want to do is add a select case statment to the after update of the list box. that will hide the subform. My issue is the the list box has 2 columns how do i attach the select case to one of those headings.
eg.
select case (record selected)
case Todd
   hide subform
case Mike
   hide subform
end select
0
 
LVL 30

Expert Comment

by:hnasr
ID: 22607415
Private Sub lstBox_AfterUpdate()
    Select Case lstBox.Column(0)
        Case Is = "Todd"
            Me!frmY.Visible = False
        Case Is = "Mike"
            Me!frmY.Visible = True
        End Select      
End Sub
0
 
LVL 1

Accepted Solution

by:
atreidies earned 0 total points
ID: 22614228
Ive tried a few variations of this:

Private Sub List6_AfterUpdate()
Select Case List6.Column(0)
    Case Is = "0164"
    Me!EmploymentTypeDescriptionssubform.Visible = False
End Select
End Sub

Without success and took a different route....but thanks for the help.
0

Featured Post

Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Phishing attempts can come in all forms, shapes and sizes. No matter how familiar you think you are with them, always remember to take extra precaution when opening an email with attachments or links.
In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…
Suggested Courses

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question