cancel
Showing results for 
Search instead for 
Did you mean: 

UI - Testing the Selected value in a combobox

Former Member
0 Kudos

Hi,

how can i test if a combobox have a selected value ?

If I write this code and i have not select any value

If TestCombo.Selected.Value = "" Then

...

end if

I get the error : "object variable or with block variable

not set"

Thanks

Andrea

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

If nothing is selected in a combo, the "Selected" property will be set to nothing:

If TestCombo.Selected Is Nothing Then

'nothing selected

else

If TestCombo.Selected.Value = "" Then

...

end if

end if