Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

List Box Question

Status
Not open for further replies.

Igawa29

MIS
Jan 28, 2010
99
US
So here is my issue. I have a list box that gives me my records, and when I click on this list box it gives me another set of records. How can I make it where once I click the first list box, something will automatically click the second list box? I want to avoid having to click twice.
 


Hi,

How would it read your mind or that of anyone else, in order to know which item in the second list box to choose?

Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
Basically here is how its set up:

Listbox 1: A, B, C, D, E

Listbox 2: Depends on Listbox 1 pick it can be: A1, B1, C1, D1, E1

Listbox 3: Depends on Listbox 1 pick it can be: A2, B2, C2, D2, E2

So Listbox 1 is going to drive what shows up in Listbox 2 and 3.
 


Please post a concrete example of

1) List1 values

2) a List1 SELECTION

3) the result in List2 from the List1 selection.

4) what you expect to automatically happen with List2


Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
I actually just solved my own issue.. however another arose, so I will let you know what everything looks like:

Listbox1: Shows a query run from table1, displaying cars: So Hyundai, Honda, Toyota, etc...

Listbox2: Shows a query run from table1 and listbox1, displaying car parts depending on the type of car selected in listbox1

Listbox3: Shows a query run from table1 and listbox1 and listbox2, displaying installation instructions depending on the type of car selected in listbox1 and listbox 2


Now I have figured out that a me.refresh will actually change the listbox2 and listbox 3... however I needed to send an output to a text box since list boxes do not word wrap so I coded:

Me.Text2 = "'" & Me.List2 & "'"
Me.Text3 = "'" & Me.List3 & "'"

Now the listboxes update with their data, but the text boxes will not update unless I click on the listbox first... so frustrating.

So text box 2 will not refresh without me clicking on listbox 2.. and text box 3 will not refresh without me clicking on listbox 3.




 
See faq702-4289


Greg
People demand freedom of speech as a compensation for the freedom of thought which they seldom use. Kierkegaard
 
Greg,
Thanks for the link, I tried a few things based on what was discussed and it crashed my code.. here is my exact code that I am working with:

Code:
Private Sub List10_click()
Me.Refresh
Me.List12.SetFocus
Me.List12.Selected(0) = True
End Sub

Private Sub List12_AfterUpdate()
Me.Refresh
Me.List14.SetFocus
Me.List14.Selected(0) = True
End Sub

Private Sub List10_AfterUpdate()
Me.Refresh
End Sub

Private Sub Text37_AfterUpdate()
Me.Refresh
End Sub

Private Sub Text39_AfterUpdate()
Me.Refresh
End Sub

[\code]


So basically I have to click on List10 three times in order to get my code to work.  The first click changes the values of list12 and list14... The second click changes the value of Text37, and The third click changes the value of Text39.   So what i need is to have one click do all that.  I appreciate all the comments getting me in the right direction.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top