index on {expression} for {filter expression} tag whatever of {cdxFileName}The "of {cdxFileName}" is recommended, because if you have a read-only cursor, you can give it only one tag without it; if you try a second one, it complains about being read-only. But that holds only for the structural index, i.e. the one which has the same filename as the table. Use your favorite random name generator to create this filename. In VFP7, you can create the cursor as ReadWrite; in VFP6 you can use the regular
Use (dbf("cursoralias")) again in 0 alias NewAliastrick to make the cursor read-write. If it's read-write, you can index it any way you like. In your grid, just set the order of your cursor to this tag and there you are. Make sure you issue a locate or any other record movement between indexing and refreshing the grid, just to make sure you're not sitting on an invisible record (maybe this is not needed at all, but just in case).