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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

LIST BOXES AGAIN

Status
Not open for further replies.

phly9

Programmer
Apr 26, 2001
6
US
i have a set of list boxes (3), the first one is just a list, the second list box displays the information pertaining to the first list box item that is clicked, now i need the last list box to be able to display information on the item clicked in the second list box. (but the information in the second list box is always different depending on the items that are clicked in the first list box) i have the first box set up, and the second as well (i am using cases in the second) (did you follow all that) can i do some sort of code like this:

private sub list2_click
if list1_click case 0 and list2_click case 0 then
list3.additem "123"
if list1_click case 1 and list2_click case 1 then
list3.additem "456"
end if
end sub

i know this is not possible (i tried)
but what is that code i would use to do something like this???

any help is appreciated
 
Hi,
I'm not sure if it applies but you can define a 2 variable function, something like:

Function Box3Index(riListIndexBox1 as integer,
riListIndexBox2 as integer) as string
'and here you can say for example
if riListIndexBox1=0 then
select case riListIndexBox2
case 0
Box3Index=NNNN
case 1
Box3Index=PPPP
end select
else if riListIndexBox1=1

.....etc
end if
(2 functions would be more efficient)

You call this function in the click event of both listbox1 and listbox2:
private sub listbox1_click()
listbox3.listindex=_
Box3Index(listbox1.listindex,listbox2.listindex)
end sub

private sub listbox2_click()
listbox3.listindex=_
Box3Index(listbox1.listindex,listbox2.listindex)
end sub

MR

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top