Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Restore cursor after scan
Message
From
21/01/2018 04:33:04
 
 
To
21/01/2018 04:19:08
Walter Meester
HoogkarspelNetherlands
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows 10
Network:
Windows Server 2012 R2
Database:
MS SQL Server
Application:
Desktop
Miscellaneous
Thread ID:
01657368
Message ID:
01657405
Views:
46
>>Use the SQL command Update instead. I do it regularly, never fails.
>>
>>lnRecno = recno('bi')
>>Update bi set something = anotherthing where myref='AA'
>>Goto lnRecno in bi
>>Yourgrid.refresh()
>>Yourgrid.setfocus()
>>
>>>Hello comunity,
>>>
>>>I need to restore cursor position on Grid after doing a Scan to this inicial position , example:
>>>
>>>
>>>select bi
>>>mypos = recno()
>>>
>>>select bi
>>>scan
>>>IF myref  = 'AA'
>>>replace something with anotherthing
>>>Endif
>>>endscan
>>>
>>>Go record mypos
>>>
>>>
>>>But don´work.
>>>
>>>Someone could give me help about how do that.
>>>Many thanks
>>>Luis
>
>That would fail with an error if the record pointer is at EOF() beofre the update
>Better to use
>
>
LOCATE RECORD MyPos
>
>Walter,

Well, that will only happen if the previous command was Append, or the user used a keyboard shortcut to do the same. Since the OP wrote that he already was "in" a grid, I don't think that's relevant. But I agree, your fix is better.
Previous
Reply
Map
View

Click here to load this message in the networking platform