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
|
Private Sub Commande0_Click()
Dim sql As String
sql = " INSERT INTO tblReceptionfichierXLCausedesretards ( Client, [v AR-ligne], [v ref# Client : ligne], [Code article],"
sql = sql & " Article, [v representant], [v planificateur], [Qté ordre], [V fin fab prevue], [Date livraison planifiee],"
sql = sql & " [v Date modifiée accusé depart], [v Date derniere modification des dates accuses], [OF], CAP, Ligne )"
sql = sql & " SELECT Sheet1.[Def#Client], [OV] & ' - ' & [ligne] AS [V AR-ligne],"
sql = sql & " [No commande client] & ' - ' & [Numero comm# client] AS [V réf client ligne],"
sql = sql & " Sheet1.[Code Article], Sheet1.Designation, Sheet1.[Adv client],"
sql = sql & " Sheet1.Planner, Sheet1.[Qté backlog], Sheet1.[Ddée EXW],"
sql = sql & " Sheet1.[reel ddée], Sheet1.[Acc# EXW],"
sql = sql & " Sheet1.[Modif# EXW],"
sql = sql & " Sheet1.[Production order],"
' change le contenu dans le champ CAP
sql = sql & " Switch("
sql = sql & "[Family Newsletter]='Accessories for A Contactors','AU5',"
sql = sql & " [Family Newsletter]='Contactor Size 1 A9 to A16','A9',"
sql = sql & " [Family Newsletter]='Contactor Size 1 AL9 to AL16','AL9',"
sql = sql & " [Family Newsletter]='Accessories for Bar Contactors' and 'Bar Contactors < 800A' and 'Bar Contactors >= 800A','OFR',"
sql = sql & " [Family Newsletter]='Contactor Size 2 A26','A26',"
sql = sql & " [Family Newsletter]='Contactor Size 2 A30 to A40','A30-40',"
sql = sql & " [Family Newsletter]='Contactor Size 2 AL26','AL26',"
sql = sql & " [Family Newsletter]='Contactor Size 2 AL30 to AL40','AL30-AL40',"
sql = sql & " [Family Newsletter]='Contactor Size 3 A50 to A75','A50-A75',"
sql = sql & " [Family Newsletter]='New AF Contactors','AF',"
sql = sql & " [Family Newsletter]='New SNK Terminal Blocks','SNK',"
sql = sql & " [Family Newsletter]='Other contactors (UA-RA, AE, GAE, TAE
) Size 1' AND 'Other contactors (UA-RA, AE, GAE, TAE
) Size 2' AND 'Other contactors (UA-RA, AE, GAE, TAE
) Size 3','AE',"
sql = sql & " [Family Newsletter]='Sensors for Industrial Market','ANR',"
sql = sql & " [Family Newsletter]='Sensors for Railway Market','ANS' "
sql = sql & " ) AS CAP,"
' Change le contenu dans le champ Ligne
sql = sql & " Switch("
sql = sql & "[Ligne1]='L1-Terminal Blocks','L1',"
sql = sql & "[Ligne1]='L2-PCB Connection','L2',"
sql = sql & "[Ligne1]='L3-Control Signaling','L3',"
sql = sql & "[Ligne1]='L4 -PLC','L4',"
sql = sql & "[Ligne1]='L5-Contactors','L5',"
sql = sql & "[Ligne1]='L7-Current Sensors','L7'"
sql = sql & " ) AS NumLigne"
sql = sql & " FROM Sheet1;"
Debug.Print sql
DoCmd.RunSQL (sql)
End Sub |
Partager