Results 1 to 2 of 2

Thread: Display error if listbox empty.

  1. #1

    Thread Starter
    New Member
    Join Date
    Apr 2013
    Posts
    8

    Display error if listbox empty.

    I have a button in my program called 'Submit'. So when i click on this button i want it to display an error message if the listbox is empty. Please Help Me.

  2. #2
    Frenzied Member IanRyder's Avatar
    Join Date
    Jan 2013
    Location
    Healing, UK
    Posts
    1,232

    Re: Display error if listbox empty.

    Hi,

    You would test the Count property of the Items collection of the ListBox. i.e:-

    Code:
    If ListBox1.Items.Count = 0 Then
      MsgBox("No Items In ListBox!")
    End If
    Hope that helps.

    Cheers,

    Ian

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