Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Delete record in grid (relational table)
Message
De
26/02/2007 15:43:53
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Versions des environnements
Visual FoxPro:
VFP 9 SP1
Database:
Visual FoxPro
Divers
Thread ID:
01185356
Message ID:
01198945
Vues:
10
>>>Hello,
>>>
>>>I have two tables. (relation -invoice and lines.)
>>>
>>>When i want to delete record in grid, if i use theese codes;
>>>
>>>&&button click event
>>>delete in mytable
>>>skip -1 in mytabe
>>>thisform.mygrid.setfocus
>>>thisform.refresh
>>>
>>>It's ok. was deleting the record but i do not want to skip -1 ? Have another clear method?
>>
>>The problem is, if you don't do a skip - or some other command that goes to another record - Visual FoxPro will continue showing the current (deleted) record.
>>
>>The examples I learned (when learning Visual FoxPro) were something like this (I am recalling from memory):
>>
>>
>>* After asking the user for confirmation:
>>delete
>>skip
>>if eof()
>>  go bottom
>>endif
>>ThisForm.Refresh()
>>
>>
>>This should ensure that a valid record is always selected after deleting - unless there is not a single record.
>>
>>SKIP is better than doing GO BOTTOM or GO TOP from the start, since it leaves the user close to the record he was working on. Otherwise, he will have to search for the position again.
>
>I'll try that, thanks.

Neither one is needed: just delete and move focus to grid.
Edward Pikman
Independent Consultant
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform