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
| Dim strmysql As String
Dim RunMySQL As String
Dim VrEMEI As String
Dim VrSIM As String
Dim VrUSER_ID As String
'DoCmd.SetWarnings False
If "" & Recherche_Employé.Value = "" Then
MsgBox "Vous avez oublié de choisir l'Employé"
End If
If "" & Me.Liste_Equipement = "" Then
MsgBox "Vous avez oublié de choisir l'Equipement"
Else
strmysql = "UPDATE Equipement SET Equipement.Statut_Equipement = ""Affecté"""
strmysql = strmysql & " WHERE (Equipement.Num_EMEI = """
strmysql = strmysql & Me.Liste_Equipement
strmysql = strmysql & """);"
DoCmd.RunSQL strmysql
End If
If "" & Liste_Abonnemen.Value = "" Then
MsgBox "Vous avez oublié de choisir l'Abonnement"
Else
strmysql = "UPDATE Abonnements SET Abonnements.Statut_Abo = ""Affecté"""
strmysql = strmysql & " WHERE (Abonnements.Num_SIM = """
strmysql = strmysql & Me.Liste_Abonnemen
strmysql = strmysql & """);"
DoCmd.RunSQL strmysql
End If
MyDate = Date$
DoCmd.SetWarnings True
RunMySQL = "INSERT INTO [Affectation] (User_ID, PIN_Terminal, PIN_SIM, Coque, Vitre, Support_Vehicule, Num_EMEI, Num_SIM, Date_Début, Date_Fin, Actif, Statut_Affectation, Commentaire, Or_Affectation1, Statut)"
RunMySQL = RunMySQL & " SELECT """
RunMySQL = RunMySQL & Me.Recherche_Employé
RunMySQL = RunMySQL & """, PIN_Terminal, PIN_SIM, Coque, Vitre, Support_Vehicule, """
RunMySQL = RunMySQL & Me.Liste_Equipement
RunMySQL = RunMySQL & """, """
RunMySQL = RunMySQL & Me.Liste_Abonnemen
RunMySQL = RunMySQL & """, #"
RunMySQL = RunMySQL & MyDate
RunMySQL = RunMySQL & "#, Date_Fin, Actif, Statut_Affectation, Commentaire, Or_Affectation1, Statut"
RunMySQL = RunMySQL & " FROM [Affectation] WHERE [Affectation].Or_Affectation =" & Or_Affectation & " ;"
DoCmd.RunSQL RunMySQL
DoCmd.RunCommand acCmdSaveRecord
Me.Requery
Me.Refresh
'DoCmd.RunCommand acCmdSaveRecord
End Sub |
Partager