cancel
Showing results for 
Search instead for 
Did you mean: 

Check combo box for valid value

Former Member
0 Kudos

Hey Everyone,

I was wondering if someone could tell me the correct method for checking a combo box list of valid values to ensure it contains a certian value before trying to select it. The problem I have is sometimes my code ends up trying to select a value that does not exist in the combo box and it throws an exception.

Any help would be appreciated.

View Entire Topic
Former Member

You could try something like this:


vvs = itm.Specific.ValidValues
blnFound = False
For Each vv in vvs
  If vvs.value = strMyValue Then
     blnFound = true
     Exit For
  Endif
Next For 

If blnFound Then
   itm.Specific.Select(strMyValue)
Else
   MsgBox ("Hey man! That was not an option.")
Endif
 

HTH

Juha