Skip to Content
author's profile photo Former Member
Former Member

ComboBox

how to check combo selected value to string and if combo box selected value is empty, how to compare to empty string

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Dec 01, 2007 at 07:48 AM

    Hi Madhu,

    You can do it by putting your value checking in a try...catch clause like displayed below. If an error is received it means no entry is selected in the combo box. The value field should always have a value, so it can't be blank with a valid entry. If you receive a blank value you know nothing is selected.

    try
         sValue = oCombo.Selected.Value
    catch
         sValue = ""
    end try

    Hope it helps,

    Adele

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 01, 2007 at 08:59 AM

    here:

    If ComboBox.Selected = Nothing Then
      MsgBox("No value selected in combo")
    Else
      MsgBox("Selected value in combo is " & ComboBox.Selected.Value)
    End If
    

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.