>This is the code under a text1 textbox's lostfocus. So when they type in cStockCodeFilter in the text1 and tab out the grid filters.
>
Try with the changes I made to the code bellow.
>SELECT tbl
>
>DO CASE
> CASE empty(cStockCodeFilter)
> SET FILTER TO
> otherwise
SET FILTER TO StockCode = cStockCodeFilter
>ENDCASE
>
>locate
>Thisform.grid1.Refresh
>-----------------------------------------------------
>
>I also have a Doubleclick method under the StockCode column so they can just double-click on the stockcode and it does the following:
>
>cStockCodeFilter = ALLTRIM(StockCode)
>thisform.text1.Refresh
>thisform.text1.LostFocus
>SELECT tbl
>GO TOP
>thisform.Refresh
>-----------------------------------------------------
>
>Let me know if you need more info.
From this code I can guess that cStockCodeFilter variable defined as global somewhere. Otherwise this filter would not work at all.
I would probably not use filters at all in my application, but that's a different story...
If it's not broken, fix it until it is.
My Blog