I'm using the QBF solution form that is with VFP 9.0. How can I make it so that the search doesn't need to be case sensitive If I want to search for David, I want my users to be able to type in david & still find that record.
You could do that. Basically in your example you could UPPER() the search string in your cCondition variable, or in whatever the ParseCondition() method returns.
Search Form
Gary Nicol
Here is my code for my search command button:
New" color="#0000ff" size="2">
LOCAL
New" size="2">cFiltercFilter = ""
New" color="#0000ff" size="2">FOR New" size="2">nCnt = 1 New" color="#0000ff" size="2">to THISFORMNew" size="2">.New" color="#0000ff" size="2">ControlCount
IF TYPENew" size="2">('THISFORM.Controls(nCnt).controlSource') <> "U" THEN
IF !EMPTY(THISFORM.Controls(nCnt).ControlSource) AND ;
TYPE('THISFORM.Controls(nCnt).value') <> "U" THEN
cCondition = THISFORM.parseCondition(THISFORM.Controls(nCnt).value,THISFORM.Controls(nCnt).controlSource) IF !EMPTY(cCondition) THEN cFilter = cFilter + " AND " + cCondition ENDIFENDIF
ENDIF
ENDFOR
ROLLBACK
THIS
.Enabled = .F.THISFORM
.cmdQBFMode.Enabled = .T.THISFORM
.txtEmp_ID.readonly = .T.IF
!EMPTY(cFilter) THEN cFilter = ALLTRIM(SUBSTRC(cFilter,5))ENDIF
SET FILTER TO
&cFilterTHISFORM
.cmdClearFilter.enabled = .T.THISFORM
.vcr1.enabled = .T.THISFORM
.vcr1.cmdTop.clickTHISFORM
.RefreshChien-hao Wesley Wen
gimo
The way to do case-insensitive searches is to convert all to one case.
Index your key field in UPPER(fieldname). Then convert your search string to uppercase behind the scenes.
cSearch = UPPER(cSearch) && "David" gets converted to "DAVID"
Then you search in all uppercase.