1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95
| Private Sub CommandButton4_Click()
Dim Vmess As String
Dim Verr As Integer
Dim Vnum As Long
Vmess = ""
Verr = 0
If FrmOp.CheckBox1.Value = False And FrmOp.CheckBox2.Value = False Then
Verr = 1
Vmess = Vmess + Chr(10) + "Débit ou crédit?"
End If
If FrmOp.TextBox2 = "" Then
Verr = 1
Vmess = Vmess + Chr(10) + "La date de l'opération"
End If
If FrmOp.CheckBox2.Value = True Then
If FrmOp.CheckBox6.Value = False And FrmOp.CheckBox7.Value = False And FrmOp.CheckBox8.Value = False And FrmOp.CheckBox10.Value = False Then
Verr = 1
Vmess = Vmess + Chr(10) + "Quel est le mode de versement?"
End If
If FrmOp.ComboBox1.Value = "" Then
Verr = 1
Vmess = Vmess + Chr(10) + "Quelle est la banque?"
End If
If FrmOp.ComboBox2.Value = "" Then
Verr = 1
Vmess = Vmess + Chr(10) + "Quel est l'objet?"
End If
If FrmOp.ComboBox3.Value = "" Then
Verr = 1
Vmess = Vmess + Chr(10) + "Ajouter le détail"
End If
End If
If Verr = 1 Then
MsgBox "Vous avez oublié" + Vmess, , "Attention"
Exit Sub
End If
ActiveSheet.Activate
If Range("a13") = "" Then
Range("a13").Select
Vnum = 1
Else
Range("a12").End(xlDown).Select
Vnum = Selection.Value + 1
ActiveCell.Offset(1, 0).Range("a1").Select
End If
ActiveCell.Value = Vnum
ActiveCell.Offset(0, 2).Value = CDate(FrmOp.TextBox1)
ActiveCell.Offset(0, 3).Value = CDate(FrmOp.TextBox2)
ActiveCell.Offset(0, 4).Value = FrmOp.ComboBox1.Value
ActiveCell.Offset(0, 5).Value = FrmOp.ComboBox2.Value
ActiveCell.Offset(0, 6).Value = FrmOp.ComboBox3.Value
If FrmOp.CheckBox6.Value = True Then
ActiveCell.Offset(0, 7).Value = "Virement automatique"
End If
If FrmOp.CheckBox7.Value = True Then
ActiveCell.Offset(0, 7).Value = "En liquide"
End If
If FrmOp.CheckBox8.Value = True Then
ActiveCell.Offset(0, 7).Value = "Par chèque bancaire"
End If
If FrmOp.CheckBox10.Value = True Then
ActiveCell.Offset(0, 7).Value = "Dépôt au guichet"
End If
If FrmOp.CheckBox2.Value = True Then
ActiveCell.Offset(0, 9).Value = CDbl(FrmOp.TextBox4)
End If
CheckBox1.Value = False
CheckBox2.Value = False
CheckBox3.Value = False
CheckBox4.Value = False
CheckBox5.Value = False
CheckBox6.Value = False
CheckBox7.Value = False
CheckBox8.Value = False
CheckBox9.Value = False
CheckBox10.Value = False
CheckBox1.Visible = True
CheckBox2.Visible = True
CommandButton2.Visible = True
CommandButton4.Visible = True
Frame4.Visible = True
Frame6.Visible = True
TextBox2.Text = ""
TextBox4.Value = ""
ComboBox1.Value = ""
ComboBox2.Value = ""
ComboBox3.Value = ""
End Sub |
Partager