How to determine if item is UNSELECTED in a list box?

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

Guest

I have code behind a list box that reads the 4th column to see if it says yes
or no. If it says yes it opens up another form. My problem is that if the
item is UNSELECTED it opens up the other form. Is there any way to determine
if an item in UNSELECTED?
 
what does 'unselected' mean?

You can test to see if it is 'null' by using "IS NULL"

IS NULL([SomeFieldName])...
 
Use the Selected property of the listbox.


Example:
If Me.lstMyListbox.Selected(1) Then
or
If Not Me.lstMyListbox.Selected(1) Then

1 would be the 2nd row. The index number is zero based. You can't select a
column, you can only select a row, so I'm assuming you want to know if the
row where the 4th column has the value "Yes" is selected.
 
Back
Top