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 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143
| Private Sub Commande70_Click()
'DoCmd.SetWarnings False 'bloque les messages d'avertissement
DoCmd.RunSQL "DELETE * FROM budget;"
DoEvents
DoCmd.RunSQL " INSERT INTO budget SELECT * FROM pricing;"
'DoCmd.SetWarnings False
'calcul du prix de chaque livraison en automatique
Dim rst As DAO.Recordset
Dim I As Long
Dim tarif As Long
'concerne le traitement de la requete budgetreq pour les flux LTL
Set rst = CurrentDb.OpenRecordset("budgetreq", dbOpenDynaset, dbDenyWrite)
Application.DBEngine.SetOption DAO.dbMaxLocksPerFile, 50000
With rst
.MoveLast
.MoveFirst
For I = 1 To .RecordCount ' Il existe d'autre moyens pour
' passer sur tous les enregistrements
.Edit
If !nombrepal < 34 Then
If !nombrepal = 1 Then
!prixauto = !prix1
End If
If !nombrepal = 2 Then
!prixauto = !prix2
End If
If !nombrepal = 3 Then
!prixauto = !prix3
End If
If !nombrepal = 4 Then
!prixauto = !prix4
End If
If !nombrepal = 5 Then
!prixauto = !prix5
End If
If !nombrepal = 6 Then
!prixauto = !prix6
End If
If !nombrepal = 7 Then
!prixauto = !prix7
End If
If !nombrepal = 8 Then
!prixauto = !prix8
End If
If !nombrepal = 9 Then
!prixauto = !prix9
End If
If !nombrepal = 10 Then
!prixauto = !prix10
End If
If !nombrepal = 11 Then
!prixauto = !prix11
End If
If !nombrepal = 12 Then
!prixauto = !prix12
End If
If !nombrepal = 13 Then
!prixauto = !prix13
End If
If !nombrepal = 14 Then
!prixauto = !prix14
End If
If !nombrepal = 15 Then
!prixauto = !prix15
End If
If !nombrepal = 16 Then
!prixauto = !prix16
End If
If !nombrepal = 17 Then
!prixauto = !prix17
End If
If !nombrepal = 18 Then
!prixauto = !prix18
End If
If !nombrepal = 19 Then
!prixauto = !prix19
End If
If !nombrepal = 20 Then
!prixauto = !prix20
End If
If !nombrepal = 21 Then
!prixauto = !prix21
End If
If !nombrepal = 22 Then
!prixauto = !prix22
End If
If !nombrepal = 23 Then
!prixauto = !prix23
End If
If !nombrepal = 24 Then
!prixauto = !prix24
End If
If !nombrepal = 25 Then
!prixauto = !prix25
End If
If !nombrepal = 26 Then
!prixauto = !prix26
End If
If !nombrepal = 27 Then
!prixauto = !prix27
End If
If !nombrepal = 28 Then
!prixauto = !prix28
End If
If !nombrepal = 29 Then
!prixauto = !prix29
End If
If !nombrepal = 30 Then
!prixauto = !prix30
End If
If !nombrepal = 31 Then
!prixauto = !prix31
End If
If !nombrepal = 32 Then
!prixauto = !prix32
End If
If !nombrepal = 33 Then
!prixauto = !prix33
End If
End If
If !nombrepal >= 34 Then
!prixauto = !prix33 / 33 * !nombrepal
End If
.Update
.MoveNext
Next I
End With
Set rst = Nothing
MsgBox ("la requete budget pour les flux LTL a été mise a jour")
End Sub |
Partager