J'ai un pb. A chaque fois que je saisi un montant au niveau du champ "montant avancé" le calcul automatique des autres champs est juste (txttotalrea, txtmontantpaye et txtresteapayer). Mais quand j'efface le contenu du champ txtmontantavance, le calcul des autres champs est incorrect![]()
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14 Dim mc As [Decimal] = CDec(Txtmontantc.Text) Dim total As [Decimal] = CDec(Txttotalrea.Text) Dim ma As [Decimal] = CDec(Txtmontantavance.Text) Dim var As [Decimal] If Txtmontantavance.Text = "" Then Exit Sub Txtmontantpaye.Text = CDec(Txttotalrea.Text) Txtresteapayer.Text = CDec(Txtmontantc.Text) - CDec(Txttotalrea.Text) Else var = total + ma Txtmontantpaye.Text = total + ma Txtresteapayer.Text = mc - var End If
Partager