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

listbox selection affect another listbox 2

Status
Not open for further replies.

Xenocide

Programmer
Jan 20, 2005
76
CA
Hi

I would like that when for exemple I pick the first row in a listbox, the first row in a second listbox is also selected

Thanks
 
Take a look at the ListIndex property of the ListBox object.
Note: to set the ListIndex value, the ListBox must have the focus.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Thanks it helped

But when I try to reset the focus on my previous control a error pop-up.

Say something like : can't activate lst4 control

here's my code

lst1.SetFocus
lst1.ListIndex = lst4.ListIndex
lst4.SetFocus
 
How are ya Xenocide . . . .

[blue]ListIndex[/blue] is a [purple]Read Only[/purple] property of List/Combo boxes! . . . Also, Unless you have some reason, the [blue]focus manipulation is not needed[/blue].

According to the code you've provided, in the [blue]AfterUpdate[/blue] event of lst4, copy/paste the following:
Code:
[blue]   Me!lst1.Selected(Me!lst4.ListIndex) = True[/blue]

Calvin.gif
See Ya! . . . . . .
 
theAceMan1 said:
ListIndex is a Read Only property of List/Combo boxes[/i]
At least in ac2003, provided the ListBox has focus you can change its ListIndex.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top