Change selected/select an item in a list on a form

CrArC

Registered User.
Local time
Today, 23:07
Joined
Oct 7, 2006
Messages
25
Hi there,
Is there a way to change the currently selected item in a list on a form using Visual Basic? I need to be able to change the currently highlighted item in a list (move it up or down, or select a specific item) but i can't find the syntax! For example I was playing with things like:
Code:
listname.listindex "x".setfocus
Hopelessly wrong? :o

Any help appreciated!!
 
Try

Me.ListBoxName.Selected(0) = True

0 will be the first item in the list
...but
If you set the "Column Heads" property set to yes, then 1 will be the first item.
You can set the 0 as a variable to dynamically select an item.

Dave
 

Users who are viewing this thread

Back
Top Bottom