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
| Private Sub CmbOk2_Click()
Dim err_dbl As Boolean
Dim Vmess As String
Dim Ver As Integer
Vmess = ""
Ver = 0
If FrmEngt.CmbNumEng = "" Then
Ver = 1
Vmess = Vmess + Chr(10) + "Le N° d'Engagement"
End If
If FrmEngt.TxtNumFact = "" Then
Ver = 1
Vmess = Vmess + Chr(10) + "Le N° de Facture"
End If
If FrmEngt.TxtDateFact = "" Then
Ver = 1
Vmess = Vmess + Chr(10) + "La Date de la Facture"
End If
If FrmEngt.TxtMontFact = "" Then
Ver = 1
Vmess = Vmess + Chr(10) + "Le Montant"
End If
If Ver = 1 Then
MsgBox "Vérifiez vous avez oublié" + Vmess, , "Avertissement"
Exit Sub
End If
Sheets("Factures").Activate
If Range("A6") = "" Then
Range("A6").Select
Else
Range("A5").End(xlDown).Select
ActiveCell.Offset(1, 0).Range("A1").Select
End If
err_dbl = False
If trouve_identique("B", FrmEngt.TxtNumFact.Value) = True Then
err_dbl = True
End If
If (err_dbl = False) Then
FrmEngt.CmbNumEng.SetFocus
ActiveCell.Offset(0, 0).Value = FrmEngt.CmbNumEng.Value
ActiveCell.Offset(0, 1).Value = FrmEngt.TxtNumFact.Value
ActiveCell.Offset(0, 2).Value = FrmEngt.TxtDateFact.Value
ActiveCell.Offset(0, 4).Value = CDbl(FrmEngt.TxtMontFact)
ActiveCell.Offset(0, 8).Value = FrmEngt.LabOui.Caption
ActiveCell.Offset(0, 9).Value = FrmEngt.LabNon.Caption
ActiveCell.Offset(0, 16).Value = FrmEngt.CmbSite.Value
Load FrmEngt
FrmEngt.CmbNumEng = ""
FrmEngt.LstMont.Clear
FrmEngt.LstTier.Clear
FrmEngt.LstBat.Clear
FrmEngt.TxtNumFact = ""
FrmEngt.TxtDateFact = ""
FrmEngt.TxtMontFact = ""
FrmEngt.CmbSite = ""
FrmEngt.LabOui = ""
FrmEngt.LabNon = "X"
Else
MsgBox "Attention ce numéro de facture existe déjà...Veuillez recommencer", vbOKOnly
End If
End Sub |