filtered records not shown correctly in a grid aftger grid has got focus

filtered records not shown correctly in a grid aftger grid has got focus

Post by andipfaf » Wed, 07 Dec 2005 02:14:46


Hi there,

when calling the customers list function in my foxpro application I get
all records from my MySQL database (customer's table) via ODBC. Then I
call a form which has a grid controlling id an name fields of the
customer table. A text field is used to filter records by name. If you
enter something in that field, I am doing a

SET FILTER to OCCURS(UPPER(thisform.searchword), UPPER(customer.name))
GO top in customer
thisform.grid_wa.refresh()

Everything works fine until the grid gets the focus after entering the
search information. After getting the focus only one (instead of three
found) record is shown, it is alwas the first one in the list. If I do
a "thisform.grid_wa.setfocus()" instead of the refresh, nothing at all
is shown.

Doing a
SET FILTER to OCCURS("Miller", UPPER(customer.name)) > 0
instead of using the thisform.serachword variable works without problem
so I guess there is something wrong with the SET FILTER and using
variables?

I am using VFP8 on W2k english.

Thanks in advance
Andi
 
 
 

filtered records not shown correctly in a grid aftger grid has got focus

Post by Dan Freema » Wed, 07 Dec 2005 07:06:39

I'd recommend against SET FILTER in general, and in this particular case a
parameterized remote view will definitely be better and has most of what
you're looking for built-in.

Dan