Solved

Hiding a subform with a multiple column listbox

Posted on 2008-09-30
6
356 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
  • 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
Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

 
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

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

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

Introduction When developing Access applications, often we need to know whether an object exists.  This article presents a quick and reliable routine to determine if an object exists without that object being opened. If you wanted to inspect/ite…
QuickBooks® has a great invoice interface that we were happy with for a while but that changed in 2001 through no fault of Intuit®. Our industry's unit names are dictated by RUS: the Rural Utilities Services division of USDA. Contracts contain un…
Familiarize people with the process of utilizing SQL Server views from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Access…
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…

778 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