>Hi,
>
>I have a table containing around 200,000 record.
>On a form I have a text box that calls a SET FILTER command on the last name.
>
>SET FILTER TO ALLTRIM(UPPER(LNAME)) = ALLT(UPPER(THISFORM.txtBox.Value))
>
>The performance in some cases is very slow and ideas???
>
>Thanks
Couple problems:
1) Filters don't work with form's properties. You should use
lcFilter = 'upper(lName)=['+ALLT(UPPER(THISFORM.txtBox.Value))+']'
set filter to &lcFilter
I assume, you have index on upper(lName) and not alltrim(upper(lName)). You should not use alltrim function in indexes (You can use it in combination with padr). Using this expression it would be optimizable.
After setting filter you should move record pointer. E.g. locate after set filter command
2) Filters are slow in general. You may want to check SET KEY command in Help and P-Views.
If it's not broken, fix it until it is.
My Blog