>LOCAL lnRecNo >*** if we have a field - let's sort >IF NOT EMPTY( This.cSortField ) > *** There seems to be a refresh issue here > *** because even though the data is in the cursor > *** it is not showing up in the grid after the sort > *** and it looks like it is related to AllowCellSelection being .F. > This.AllowCellSelection = .F. > This.Refresh() > KEYBOARD '{CTRL+TAB}' > > lnRecNo = RECNO( This.RecordSource ) > *** Go ahead and set the order for the table > SELECT ( This.RecordSource ) > IF NOT EMPTY( This.cSortOrder ) > SET ORDER TO ( This.cSortField ) DESCENDING > ELSE > SET ORDER TO ( This.cSortField ) > ENDIF > This.SetFocus() > IF lnRecNo # 0 > GO lnRecNo IN ( This.RecordSource ) > ENDIF >ENDIF >