Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Como fazer Somatório de registros na GRADE
Message
De
07/02/2003 11:07:18
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00749851
Message ID:
00750620
Vues:
19
Caro Rodoufo, um colega meu já me deu a dica do somatório em uma grade num formulario de UM PARA N.
Tabela pai: LICITAÇÃO.DBF
tabela filho: CONTRATO.DBF
compo de relacionamento: LICITA_ID

O código ficou assim: (o código tem que estar dentro da GRADE no procedimento REFRESH)


Local lcOldAlias,;
lnOldRecNo,;
lnTotal

m.lnTotal= 0
m.lcOldAlias= Alias()
Select Contrato
m.lnOldRecNo= IIf( EoF(), 0, RecNo() )
Go Top
Set Near On
=Seek( Licitacao.licita_id )
Set Near Off
Scan While licita_id == Licitacao.licita_id
m.lnTotal= m.lnTotal + valorcont
EndScan
If m.lnOldRecNo > 0
Go m.lnOldRecNo
Else
Go Top
EndIf
Select ( m.lcOldAlias )
ThisForm.TxtValorcont.Value= m.lnTotal
ThisForm.TxtValorcont.Refresh()
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform