'Procédure de mise à jour de la table à partir des données récupérées dans le tableau Function Copier(NOM As String, valeur As String) Dim ReqTab As String ReqTab = "UPDATE [GLOBAL] SET [GLOBAL]." & NOM & "=" & valeur & " WHERE (((GLOBAL.NUMCONTRAT)=" & Forms!D10246_saisie!NUMCONTRAT & "));" DoCmd.SetWarnings False DoCmd.RunSQL ReqTab DoCmd.SetWarnings True End Function 'Procédure de récupération des valeurs du formulaire dans un tableau Private Sub Copie_Click() Dim Tableau_champs(72) As String Dim Counter As Integer Dim valeur As String Dim NOM As String Counter = 0 Tableau_champs(0) = "Prime1Recu" Tableau_champs(1) = "Prime1Distri" Tableau_champs(2) = "Prime2Recu" Tableau_champs(3) = "Prime2Distri" Tableau_champs(4) = "VisiteCom" Tableau_champs(5) = "VisitePenelope" Tableau_champs(6) = "ACSociete1" Tableau_champs(7) = "ACproduits1" Tableau_champs(8) = "ACcatalogue1" Tableau_champs(9) = "ACbri2" Tableau_champs(10) = "ACSociete2" Tableau_champs(11) = "ACproduits2" Tableau_champs(12) = "ACcatalogue2" Tableau_champs(13) = "ACbri3" Tableau_champs(14) = "ACSociete3" Tableau_champs(15) = "ACproduits3" Tableau_champs(16) = "Commentaires" Tableau_champs(17) = "ACcatalogue3" Tableau_champs(18) = "ACbri4" Tableau_champs(19) = "ACSociete4" Tableau_champs(20) = "ACproduits4" Tableau_champs(21) = "ACcatalogue4" Tableau_champs(22) = "ACbri5" Tableau_champs(23) = "ACSociete5" Tableau_champs(24) = "ACproduits5" Tableau_champs(25) = "ACcatalogue5" Tableau_champs(26) = "ACbri6" Tableau_champs(27) = "ACSociete6" Tableau_champs(28) = "ACproduits6" Tableau_champs(29) = "ACcatalogue6" Tableau_champs(30) = "ACbri7" Tableau_champs(31) = "ACSociete7" Tableau_champs(32) = "ACproduits7" Tableau_champs(33) = "ACcatalogue7" Tableau_champs(34) = "ACbri7" Tableau_champs(35) = "ACSociete7" Tableau_champs(36) = "ACproduits7" Tableau_champs(37) = "ACcatalogue7" Tableau_champs(38) = "ACbri7" Tableau_champs(39) = "ACSociete7" Tableau_champs(40) = "ACproduits7" Tableau_champs(41) = "vte_lundi" Tableau_champs(42) = "vte_mardi" Tableau_champs(43) = "vte_mercredi" Tableau_champs(44) = "vte_jeudi" Tableau_champs(45) = "vte_vendredi" Tableau_champs(46) = "vte_samedi" Tableau_champs(47) = "vte_dimanche" Tableau_champs(48) = "vte_total" Tableau_champs(49) = "TG" Tableau_champs(50) = "Meuble" Tableau_champs(51) = "Rayon" Tableau_champs(52) = "PVC" Tableau_champs(53) = "Dandy_present" Tableau_champs(54) = "RuptHL" Tableau_champs(55) = "RuptHMa" Tableau_champs(56) = "RuptHMe" Tableau_champs(57) = "RuptHJ" Tableau_champs(58) = "RuptHV" Tableau_champs(59) = "RuptHS" Tableau_champs(60) = "RuptHD" Tableau_champs(61) = "HActivité_matin" Tableau_champs(62) = "HActivité_Ap_midi" Tableau_champs(63) = "Vte_total_rupture" Tableau_champs(64) = "Anim_concurrente" Tableau_champs(65) = "Moyens" Tableau_champs(66) = "pstVte_pduit" Tableau_champs(67) = "Avis_cons" Tableau_champs(68) = "AppelDRVerifMatos" Tableau_champs(69) = "AppelDRVerifConnai" Tableau_champs(70) = "TotalToutProduits" Tableau_champs(71) = "FormSalle" Do While (Counter <= 72) NOM = Tableau_champs(Counter) valeur = NOM & ".Value" Call Copier(NOM, valeur) Counter = Counter + 1 Loop MsgBox "La copie est terminée.", vbInformation, "Copier" End Sub