Hi Barbara,
I actually attempted this solution before and it didn't work. I inserted your code and still have the same problem. If I click the from column to column something gets confused and the pointer is nowhere near where it should be. For some reason it doesn't want to GOTO the record even when I force it. I've re-done the form using VFP base classes and get the same results. I must be doing something wrong but I can't spot it.
>>Once again I have no doubt the solution is simple but……
>>
>>I have a grid whose control source is one table. I have several indexes in a CDX. I have placed the code:
set order to <FieldName>
>>thisform.refresh( )
in the header.click The order gets set alright but the record pointer doesn’t necessarily stay on the current record when CLICKing on the various headers. Why is that and how should I address this issue?
>
>Just save the record pointer before you SET ORDER TO, and GOTO it afterwards:
>
>lnCurRecNo = recno()
>set order to <FieldName>
>if lnCurRecNo <= reccount()
> goto lnCurRecNo
>endif
>thisform.refresh()
>
Jim Philippi
quando omni flunkus moritati