Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Delete class for parent/child
Message
De
22/05/1998 08:53:21
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
 
 
À
19/05/1998 14:49:08
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Divers
Thread ID:
00098115
Message ID:
00101122
Vues:
32
>>>Yes, I'm using RI. But the problem is that after I delete a child record, the next record is displayed, but it's not a child of the current parent, but of another parent.
>>>Sylvia
>>
>>I guess the relationship between your parent and child has been broken. Are you using link master on your grid? Or you are using the traditional set up for relationships?
>
>Janet -
>I looked into this a little further to see exactly what the delete action was doing, and it just skips to the next record. So I'm either going to have to write something to tell it to see if the next record is a child of the parent or create a view to limit what is seen.
>Sylvia

There's a nice little kludge, which probably still works. Set Key To [whatever_expression]. If you're not using a view, but some table ordered by parent key, simply

Set Key To ThisForm.ParentKey.Value

on your childtable. Put it in parent key control's LostFocus or something, or the grid refresh (just guessing the proper location).

Pros:
it's easy
Cons:
if you change order of your chld table, you see all the records again;
if you forget to Set Key To (nothing) in the end, you won't see any other records even if you need them;
you have to watch out for other places in your form where you may need to access other records in child table - you won't be able to find them.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform