cancel
Showing results for 
Search instead for 
Did you mean: 

ComboBox

Former Member
0 Kudos

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

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

here:

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

Former Member
0 Kudos

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