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

Help with listboxes

Status
Not open for further replies.

adi316

Programmer
Sep 10, 2002
35
CA
Hi. I got a prog which has 3 listboxes in a form and as it is right now when i click on an item from a different listbox then the one im in it will select the first item in the list and not the one i clicked on, which is what i want. (i.e: i click on the second item but always selects the first) how do i fix this? TIA!
 
Check the code in the listbox click event. It may be selecting item 0 all the time.
 
it is but how do i change it? how do i kbow what item the user clicked on?
 
Hello ....

The number of the item you have selected is in the "Listbox.listindex" property.

As for the problem you've mentioned ... I'm not sure what exactly you want to do but as 'aklein' said try to check the CLICK event of all 3 listboxes to make sure that there are no cascading events.

If you do the following it will result in a cascading effect which eventually will result in an 'Out of Stack error'

---------------------------------------------------------
Private sub Listbox1_Click()
Listbox2.listindex = # 'any number
end sub

Private sub Listbox2_Click()
Listbox1.Listindex = # 'any number
end sub
---------------------------------------------------------

If you click in either listbox (even on an already selected choice) each sub will call the other one on until you run out of memory.

ARISTON Engineering Ltd
Michael Vezyrgianopoulos
R&D Manager
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top