Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Refresh Table After Delete
Message
From
08/12/1997 18:35:36
Dragan Nedeljkovich
Now officially retired
Zrenjanin, Serbia
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00063847
Message ID:
00064546
Views:
53
>>skip 0 >>and >>go recno() >I've tried these, but SKIP 0 doesn't work (any more?), and go recno() >doesn't work in the context, since the deleted record still is available, >and we're not sure what recno() to go to. What I've finally done is: >
>delete
>if eof() && sometimes delete last record moves pointer to eof
>go bottom
>endif
>skip 1 && these skips move pointer
>skip -1 && to correct place
>
>This gives a full table refresh, and sets the pointer at the correct >record, at least in my tests thus far... Just for total purists - this may give strange results in case you have one record and delete it. The time when this may happen is when user is testing it before using it for real - makes one record, deletes it, puf: the 'skip -1' line would try to go past BOF(), but it really gets you left past Eof() (just tried it). Fox won't complain, but your form should really behave as if the table was empty, and you can't test recc(), you should check for locate/found()... a real PITA, if you want to do it thoroughly. I really don't know how to solve it without showing the deleted record (but then I'd change the 'delete' on cmdDelete to 'UNdelete', and change its .click appropriate). The irony of it is that it happens just at the beginning and never more, but then, the beginning really is the time when it should work flawlessly.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform