Results 1 to 3 of 3
  1. #1
    Join Date
    Jun 2002

    Unhappy Unanswered: how to print an error msg when no value in listbox??

    Maybe it's a stupid question but I just can't find the answer.

    I have two comboboxes, one for object IDs and the other for parameters. The user can select the object ID and select the parameter to be displayed. The result of the parameter is searched via a query embedded to the vb-code. The result appears in a listbox. Now, I'd like to print a message if there's no value for the parameter, i.e. the list box is empty/doesn't contain a value. How to do this??
    I tried if statements like

    If (Not Len(lstResult.Column(0))) Then
    If (Val(lstResult) = "") Then
    If IsNull(lstResult) Then

    but they don't work!! These little tricks are driving me nuts!

  2. #2
    Join Date
    Jul 2002
    Alexandria, VA (DC Metro Area)
    You should be able to use the .ListCount property to determine the number of items in your list or combo box. If the ListCount property is equal to 0, then you know that there's nothing in there.

  3. #3
    Join Date
    Jun 2002
    Thank you, Samuel! I thought it was something simple...

Posting Permissions

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