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

Setting Selected Item in ListBox from Code 1

Status
Not open for further replies.

innmedia

Programmer
Mar 24, 2000
108
US
Hi,

Does anyone know if it is possible to set the selected item in a list box from VBA? I need to display the listbox with a value already selected, instead of having the user make the selection (although it doesn't matter if they change it afterwards)

Thanks!
 
Hi,

Try this in the Form_Load event.

Code:
me.myListBox.Selected(1) = true

The value in the selected parameter is between 1 and the number of items in your list box.

Andrew
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top