>I have a set of records for a carrier that I display on a grid on a page of a pageframe. All kinds of issues using a filter - shouldn't use THISFORM, can't use a memory variable defined in the INIT, etc. How would I best handle the filter condition in a form, or, what would be the best way to use the resulting cursor from SQL run on a base table to update back to the base table? I don't care which at this point.
>
"Set Filter" is one of the rare occasions to use a ¯o expression without bad conscience:
Local lcFilterValue
lcFilterValue = '5'
Set Filter To numericField = &lcFilterValue
The actual problem with Set Filter on a grid.RecordSource (or a Browse) is that it works slowly (because the filter is not getting evaluated only once but almost permanently).
That's why a SQL Where filter of a Parameterized Local View or a CursorAdapter makes a much better grid.RecordSource.
In VFP9, the new grid.Optimize property is supposed to cure the Set Filter symptoms.
hth
-Stefan