AlastairOz
Technical User
I am using code form faq184-3842.
This search only searches on the first column in a list box.
Is there any way to have the search on the second column or even better the first AND second column?
Here is the code I have put in the interactive change of a text box:
thisform.txtSiteList.value = this.value
thisform.txtSiteList.refresh()
LOCAL nCnt, sSearchFor, nLen
sSearchFor = ALLTRIM(this.value)
nLen = LEN(sSearchFor)
FOR nCnt = 1 TO ThisForm.txtSiteList.ListCount
IF sSearchFor == LEFT(ALLTRIM(ThisForm.txtSiteList.List(nCnt)),nLen)
thisform.txtSiteList.Selected(nCnt) = .t.
thisform.txtSiteList.refresh()
EXIT &&Found one
endif
ENDFOR
Any ideas?
This search only searches on the first column in a list box.
Is there any way to have the search on the second column or even better the first AND second column?
Here is the code I have put in the interactive change of a text box:
thisform.txtSiteList.value = this.value
thisform.txtSiteList.refresh()
LOCAL nCnt, sSearchFor, nLen
sSearchFor = ALLTRIM(this.value)
nLen = LEN(sSearchFor)
FOR nCnt = 1 TO ThisForm.txtSiteList.ListCount
IF sSearchFor == LEFT(ALLTRIM(ThisForm.txtSiteList.List(nCnt)),nLen)
thisform.txtSiteList.Selected(nCnt) = .t.
thisform.txtSiteList.refresh()
EXIT &&Found one
endif
ENDFOR
Any ideas?