Champs nuls
Zonteo
Messages postés
111
Statut
Membre
-
yg_be Messages postés 23437 Date d'inscription Statut Contributeur Dernière intervention -
yg_be Messages postés 23437 Date d'inscription Statut Contributeur Dernière intervention -
Bonjour,
J'ai un soucis.
Quand je veux ajouter un nouvel élève il y a ce code qui pose un problême.
cnt = DCount("Montantverse", "T_verse", where)
Il pose problême parce que le champs [Montantverse] dans le sous formulaire est nul.
En effet voici ci-dessous le code dans lequel il se trouve.
Voici également le lien de mon fichier
https://www.cjoint.com/c/IDjeAlWki8S
Private Sub Montantverse_Exit(Cancel As Integer)
If IsNull(Montantverse) Then
MsgBox "Vous allez ajouter un nouveau Versement"
End If
Dim tot As Long, cnt As Long, gtot As Long
Dim where As String
where = "Ident = " & Me.Form.Parent!Ident & " and Idpaie <> " & Idpaie
cnt = DCount("Montantverse", "T_verse", where)
If cnt > 0 Then
tot = DSum("Montantverse", "T_verse", where)
Else
tot = 0
End If
gtot = tot + Me.Montantverse
If gtot > montantapayer Then
Call MsgBox( _
"ATTENTION! L'ETUDIANT(E) " & Me.Form.Parent!Nomeleve & " dont LA SOMME DES MONTANTS VERSES QUI EST = " & gtot & " FRANCS DEPASSE " & _
"LE MONTANT A PAYER QUI EST = " & montantapayer & " FRANCS.", _
vbOKOnly, "ATTENTION!")
Cancel = True
End If
voici le lien de mon fichier
https://www.cjoint.com/c/IDjeAlWki8S
J'ai un soucis.
Quand je veux ajouter un nouvel élève il y a ce code qui pose un problême.
cnt = DCount("Montantverse", "T_verse", where)
Il pose problême parce que le champs [Montantverse] dans le sous formulaire est nul.
En effet voici ci-dessous le code dans lequel il se trouve.
Voici également le lien de mon fichier
https://www.cjoint.com/c/IDjeAlWki8S
Private Sub Montantverse_Exit(Cancel As Integer)
If IsNull(Montantverse) Then
MsgBox "Vous allez ajouter un nouveau Versement"
End If
Dim tot As Long, cnt As Long, gtot As Long
Dim where As String
where = "Ident = " & Me.Form.Parent!Ident & " and Idpaie <> " & Idpaie
cnt = DCount("Montantverse", "T_verse", where)
If cnt > 0 Then
tot = DSum("Montantverse", "T_verse", where)
Else
tot = 0
End If
gtot = tot + Me.Montantverse
If gtot > montantapayer Then
Call MsgBox( _
"ATTENTION! L'ETUDIANT(E) " & Me.Form.Parent!Nomeleve & " dont LA SOMME DES MONTANTS VERSES QUI EST = " & gtot & " FRANCS DEPASSE " & _
"LE MONTANT A PAYER QUI EST = " & montantapayer & " FRANCS.", _
vbOKOnly, "ATTENTION!")
Cancel = True
End If
voici le lien de mon fichier
https://www.cjoint.com/c/IDjeAlWki8S
1 réponse
-
yg_be Messages postés 23437 Date d'inscription Statut Contributeur Dernière intervention Ambassadeur 1 588
bonjour, suggestion:where = "Ident = " & Me.Form.Parent!Ident If Not IsNull(Idpaie) Then where = where + " and Idpaie <> " + CStr(Idpaie) End If cnt = DCount("Montantverse", "T_verse", where) If cnt > 0 Then tot = DSum("Montantverse", "T_verse", where) Else tot = 0 End If gtot = tot If Not IsNull(Me.Montantverse) Then gtot = gtot + Me.Montantverse End If-
-
Voici encore le lien de mon fichier
https://www.cjoint.com/c/IDjeAlWki8S
-