Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How do I disply record in a grid after changing index
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00295803
Message ID:
00295829
Views:
23
>I have a grid with seven columns. All works great. In the click event of several headings I have some code to change the index order.
>
>select cust
>mrecno = recno()
>set order to lname ( or what ever column they clicked in)
>goto mrecno
>thisform refresh
>
>I want the grid to continue to display the currently selected record. Instead it jumps to a different record most of the time. Any suggestions?

John,

My first sufggestion is to dump all the goto rec stuff. Changing the order of a table does not move the record pointer so you don't need to restore it. Second, don't call the form's refresh, instead call the grid's refresh as in;
* Header click
select cust
set order to lname
this.parent.parent.refresh()
Previous
Reply
Map
View

Click here to load this message in the networking platform