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
|
Private Sub Modifier_Click()
On Error GoTo Err_Modifier_Click
Dim TypeDechet, Instruction, CategDech, Précision, codeONU, CAP, Designa, CondEnl, Etiquetage, Code, Design
'Récupère les valeurs de chaque colonne des listes
TypeDechetf = Me.TypeDechet.Value
Instructionf = Me.Instructions.Value
CategDechf = Me.CategDech.Value
Précisionf = Me.Précision.Value
codeONUf = Me.codeONU.Value
CAPf = Me.CAP.Value
Designaf = Me.Designa.Value
CondEnlf = Me.CondEnl.Value
Etiquetagef = Me.Etiquetage.Value
' Récuperation valeur table code nomenclature
Code = Me.SelectionCDR1.Column(0)
Design = Me.SelectionCDR1.Column(1)
'MsgBox (Code)
'MsgBox (Design)
'MsgBox (Etiquetagef)
' Insère ces valeurs dans la table
StrSQL1 = "INSERT INTO TDechets ( TypeDechet, Instruction, CategDech, Précision, codeONU, CAP, Designa, CondEnl, Etiquetage, codeNom, DesigNom)"
StrSQL2 = "SELECT '" & TypeDechetf & "','" & Instructionf & "','" & CategDechf & "','" & Précisionf & "','" & codeONUf & "','" & CAPf & "','" & Designaf & "','" & CondEnlf & "','" & Etiquetagef & "','" & Code & "','" & Design & "'"
'Exécute les requêtes
DoCmd.SetWarnings (False): DoCmd.RunSQL ((StrSQL1 + StrSQL2)): DoCmd.SetWarnings (True)
'retour formulaire menu
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acModifierRecord, , acMenuVer70
DoCmd.Close
DoCmd.OpenForm "FDechets"
Exit_Modifier_Click:
Exit Sub
Err_Modifier_Click:
MsgBox Err.Description
Resume Exit_Modifier_Click
End Sub |
Partager