Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Scan Endscan pitfall (phantom movement of record pointe
Message
From
27/07/2007 10:19:31
 
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Miscellaneous
Thread ID:
01244072
Message ID:
01244103
Views:
21
>Steps for this reproducible problem are:
>- Grid connected to table
>- text box in Column in grid has focus
>- Rightclick in column, initiate procedure from a context menu
>- procedure does Scan ALL on _same_ table as in grid, using same workarea
>- during scan loop, after so many records process, pop up a modal VFP form telling user "That's X done so far, keep going?", and get a button click from user
>- little known to me: when modal form closes, activeform and activecontrol (apparently) revert back to the prior form and the grid; grid gets focus; result: record pointer moves back to record where the rightclick was done; scan loop behaves weirdly; can't figure out why, as there is no visible clue this is happening
>- oddly, this resetting of the record pointer only happens the first time the modal form is shown; times after that, no effect
>
>Comments?

- Set the focus to another control on the from
- store the recnum of the grid's controlsource somewhere
- scan all
- reposition on the stored recnum
- set the focus back to the column

That should do it
Gregory
Previous
Reply
Map
View

Click here to load this message in the networking platform