Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Delete already!
Message
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Titre:
Divers
Thread ID:
00130334
Message ID:
00130483
Vues:
27
>Your code is in the right place. You need to have NoDefault at the end while deleting the child records AND the parent record in the grid. That is the only way I got this to work correctly for deleting records in a grid. Example:
>if MessgeBox("Really Delete This Record?") <> 6
>   NoDefault
>   Return 0
>endif
>lnSelect = Select()
>select ChildTable
>delete while ChildTable.KeyID = ParentTable.KeyID
>select (lnSelect)  && presumably the parent table
>delete next 1
>* Note: you may need to add code to move record pointer
>*       off deleted record to remove it from view.
>this.refresh() && refresh grid
>NoDefault
This is basically the same as one of the ways I tried, except I just did "delete", not "delete next 1". Does that make a difference?

Is there any difference between "delete while" and "delete all for"?

Thanks,

-Michelle
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform