>can anyone tell me why i cannot filter the fields in my table properly using this code?
>
>set fields to partno, partname
>
>my program cannot run if i insert this particular line. what did i do wrong? is this not the way to filter fields from a table?
SET FIELDS limits access to fields in a table, but that may well have undesirable consequences; for example, if indexes exist on other fields of a table, things will die quickly. For a simple example, if another field happens to be the primary key or a candidate key and you do this, you'll never be able to successfully insert a new record in the table, since you couldn't access that field while the SET FIELDS statement was in effect (the INSERT statement is limited by the current SET FIELDS setting.)
I view it as a legacy from dBASE, and have not used it in VFP at all.
What exactly are you trying to do? If you're trying to display selected fields in a browse or grid, you should simply name the fields explicitly in code rather than trying to rely on 'automagic' filtering. Obviously, you can easily specify the set of fields to include in SQL SELECTs and the like...