Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
ONE TO MANY FORM
Message
De
21/08/1997 11:30:06
 
 
À
20/08/1997 21:49:05
Nick Berryman
Computer Automation Technologies
Kennesaw, Georgie, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00045959
Message ID:
00046142
Vues:
21
>This seems to almost work, however, there is something wrong that I can't pinpoint. I put this code in the Next Button Click Property and I can do it one time properly then it will not got any further.
>
>Thanks for the help.
>
>nick
>
>>>On a one to many form:
>>>How would I create a field do display the total of all child records for the parent record that you are currently on?
>>>
>>>Nick
>>
>>Here's one way...
>>
>>put this code in your navigation control method after the parent pointer has been moved
>>
>>SELE Child
>>SUM 1, nField1, nField2 TO lnCount, lnField1, lnField2 ;
>> FOR Parent.key = Child.Key
>>SELE Parent
>>THISFORM.Refresh()
>>
>>
>>lnCount gives a count for the number of children
>>lnField1 is the numeris total for field nField1
>>lnField2 is the numeris total for field nField2
>>
>>HTH

It's hard to tell what's going wrong without knowing what's in your nextbtn.click method. I suspect that if it only works the first time, you are either forgetting to update the variable you use for parent.key, or you are refreshing the form before you recalculate.

But this is what I use (after the pointer has moved)-

sele child
count for child.key = parent.key to lnchildcount
sele parent
thisform.mytext1.value = lnchildcount

HTH
Erik Moore
Clientelligence
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform