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
|
Private Sub Commande56_Click()
On Error GoTo Err_Commande56_Click
Dim bd As DAO.Database
Dim Depa As DAO.Recordset
Dim PDC_IDC, TContrat, BaieT, cle As Integer
Set bd = CurrentDb()
Set Depa = bd.OpenRecordset("Depannage", dbOpenTable)
Depa.MoveFirst
Do While Not Depa.EOF
If (Depa("N° PDC") Or Depa("IDC")) Is Null Then
PDC_IDC = 1
End If
If (Depa("Type de contrat")) Is Null Then
TContrat = 1
End If
If (Depa("Baie")) Is Null Then
BaieT = 1
End If
If (Depa("Cle Maitre / Admin") Or Depa("Cle Esclave / Exploit") Or Depa("Cle Cryptage / Client")) Is Null Then
cle = 1
End If
If (Depa("DTR")) Is Null Then
BaieT = 1
End If
Loop
Depa.Close
bd.Close
If (PDC_IDC = 1) Then
MsgBox ("Attention ! Au moins une ligne n'a ni PDC, ni IDC. Merci de corriger")
Exit Sub
End If
If (TContrat = 1) Then
MsgBox "Attention, Au moins une ligne n'a pas de Type Contrat renseigné. Merci de corriger"
Exit Sub
End If
If (cle = 1) Then
MsgBox ("Au moins une clé d'identification n'est pas renseignée. Merci de corriger")
Exit Sub
End If
DoCmd.RunMacro "DepannageAno"
DoCmd.OpenQuery "Ajout_Cocc_Depannage_Ano_213"
Exit_Commande56_Click:
Exit Sub
Err_Commande56_Click:
MsgBox Err.Description
Resume Exit_Commande56_Click
End Sub |