>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
You can't. That's why SET KEY TO isn't very wonderful. Why not make a view? Then you can select whichever records you want very quickly in whatever order you want. You could try SET FILTER TO, but it will be horribly slow.
>Set Key to is a wondeful command. But the problem is that is I change the index i loose the recordset. How can i change the index and keep the same recordset i get when i use set key to command.
>
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Not sure I agree there Dan, on two points. First off, SET FILTER isn't necessarily slow, if it's an optimized expression (it sounds in this case as if it would be).
Second, there may be a workable solution using SET KEY (depending on the circumstances). If this is a case where Francisko will frequently or always want the same order within the SET KEY group, he could use a concatenated index. That is, set the index on LastName + FirstName, set key based on LastName, and the resulting set will still be ordered on FirstName within the SET KEY result set.
This is not perfect: this "solution" results in a longer index tag, and also requires that SET EXACT be OFF for at least the duration of the SET KEY. But if this technique is crucial to his app, and only SET KEY is giving him the speed he needs, it certainly is possible. You can't say "you can't" as you did above. That's not true.
The whole problem with the world is that fools and fanatics are always so certain of themselves, but wiser people so full of doubts. - Bertrand Russell