Results 1 to 2 of 2

Thread: Listbox items count check failing

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Jul 2001
    Location
    Maumelle, AR
    Posts
    624

    Listbox items count check failing

    Ok, I don't know what is wrong with this code, but it is not detecting when there are no items in the listbox. It ALWAYS returns that there is something in the listbox, even when there is not and keeps erroring on the line of code in BOLD.

    Code:
    Dim ActiveMedProbsResult as String
    
     If lstActiveMedProbs.Items.Count = 0 Then
                ActiveMedProbsResult = ""
            Else
                ActiveMedProbsResult = String.Join(", ", ClientActiveMedProbs)
                ActiveMedProbsResult = Left(ActiveMedProbsResult, Len(ActiveMedProbsResult) - 2)
            End If

  2. #2
    PowerPoster 2.0 Negative0's Avatar
    Join Date
    Jun 2000
    Location
    Southeastern MI
    Posts
    4,367

    Re: Listbox items count check failing

    If you put a breakpoint on the IF line, what is the value of lstActiveMedProbs.Items.Count, when there are no items in the list?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width