>I have some routines that programtically evaluate the contents of a listbox. Sometimes they miss!
>All ListItems are Upper case and all searches are upper case:
>Examples of only partial successes:
>
>To check for an item existing in a listbox:
>myform.mylist.value=mystring
This does not evaluate the contents of the listbox. This sets the value of the listbox. Do you mean MyString = MyForm.ListBox.Value?>Even though mystring equals the list.value, List index returns 0.
The ListIndex is not valued unless an item in the list has been explicitly clicked on by the user. The Value property is also an empty character until an item is clicked on. Now you can set these to initial values in the ListBox init so the first or any other item in the list is selected by default. Look at setting initial values for the properties Value and DisplayValue>
>So, thinking that point request is too quick for list box, the following OVER process was implemented:
>
>myform.mylist.listindex=myform.mylist.listindex && Wanna be sure
>for myform.mylist.listindex=1 to myform.mylist.listcount
>if myform.mylist.listitem(myform.mylist.listindex)=mystring
> myform.mylist.value=mystring
> myform.mylist.listindex=myform.mylist.listindex && Make sure the point points!
> exit
>endif
>Endfor
>
>Even the overkill method misses on occasion. Is there something else I need to be doing. Should I use some other control?
>
>Terry
Mark McCasland
Midlothian, TX USA