1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
| Private Sub TextBox4_Change()
'si il n'y a rien dans les textbox on ne calcule pas
If Me.TextBox3.Value = "" Or Me.TextBox4.Value = "" Then Exit Sub
Me.Label16.Caption = Me.TextBox3.Value - Me.TextBox4.Value
If Me.TextBox3.Value = "" Or Me.TextBox4.Value = "" Then Exit Sub
Me.Label18.Caption = Round(Me.TextBox4.Value / Me.TextBox3.Value * 100, 2)
If TextBox4 > TextBox3 Then
MsgBox "Le nombre de kilomètres pour des fins d'affaires est suppérieur au total des kilomètres parcourus", vbOKOnly
TextBox3.SetFocus
End If
End Sub |