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

UI - Testing the Selected value in a combobox

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

Add comment
10|10000 characters needed characters exceeded

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on Apr 28, 2004 at 09:49 AM

    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

    Add comment
    10|10000 characters needed characters exceeded