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

Setting the focus to a Listbox item

Status
Not open for further replies.

indigoblue

Programmer
Sep 7, 2000
9
0
0
GB
Hi there,

I've got a listbox which i can delete items from. When I delete an item I select the previous item in the listbox using

Forms!MainForm.List1.Selected(itm) = True

... where itm is the index of the previous item. Although the previous item gets selected, the focus doesn't move to this item. How can i do this?

Cheers,

Paul
 
hmmmmm

Two thing could be going on here...

add
Forms!MainForm.List1.setfocus

If that aint working what I would do is this ...


dim STR as string
STR = Forms!MainForm.List1.Selected(itm)
Forms!MainForm.List1 = STR

That should work


Cheers
 

Or simply use ...

Me.List1 = Me.List1.ItemData(Itm) Terry L. Broadbent
FAQ183-874 contains tips for posting questions in these forums.
NOTE: Reference to the FAQ is not directed at any individual.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top