Selecting an item from combobox using wild card ..
I have a combobox that has entries like "Account 1", "Accout 110", "Account at India" etc.
Combobox.select "Account *" seems be failing with an error "control item selection failed" . This is apparently because Select function in combobox does not support wild card. What to do in such cases?
Is there any simpler way -- to select a value in a combo using a wild card that matches to only one distinct entry?
I know - one tedious way rather round about way - store all the elements of the combo in an array and loop through to get the index (position) of the desired element - use wild card here. Once you get the index -- HTMLComboBox.SelectIndex function will do the rest ...
Even HTMLComboBox.FindItem does not seem to support wild card. It is crazy that "you are finding an item in a list and expect full name" - wild card support is badly required.. Right?
Re: Selecting an item from combobox using wild card ..
I have tried the code below and it works fine for me..
In the function selectvaluefromcombobox we pass HTMLButton("MM_PurchaseOrder_SearchField") which is the Object Map Entry name for the Button which is inside that Combo Box which when clicked displays the whole Combo Box items.
POD= Item which we want to search..
Do Until HTMLTD("ID='' Index=" & i & "", tpAttachNoWait).Exists = False
item = HTMLTD("ID='' Index=" & i & "").InnerText
If item = value Then
HTMLTD("ID='' Index=" & i & "").Attach
HTMLTD("ID='' Index=" & i & "").Click
ret = True
i = i + 1
selectValueFromCombobox = ret