select nothing in a listbox

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello,
I'm trying to set up defaults on a form, that populates a listbox, but with
no items selected when it first loads.
I have code where if an associated check box is checked, the listbox is
disabled, and selectedItem = Nothing. This works fine,
but on load, it always selects the 1st item in the list.

After populating my listbox, I use the code:
Me.lstCP.SelectedItem = Nothing
but it seems to make no difference...

Any suggestions?
Thanks,
Amber
 
If I am understanding you correctly, you just want to unselect everything.

This should do the trick:

ListBox1.SelectedIndex = -1

Jerel
 
Back
Top