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
| Private Sub Mouvements_AfterUpdate()
If Me.Mouvements < Me.Qte_Commandee Then
chkBackOrder = -1
chkArrivée = -1
DateModification = Date
MsgBox "Commande rentree est plus petit que la quantité commandée." & Chr(13) & _
"Ceci genère un Back-order"
Dim strSql As String
Dim strN°Document As String
Dim strN°IdProduit As String
Dim strDésignation As String
Dim strMouvements As String
Dim strEmplacement As String
Dim strDateModification As String
Dim strprixAchatUHT As String
Dim strIDMagasin As String
strN°Document = DMax("[BackOrderID]", "BackOrder")
strN°Document = strN°Document + 1
strN°IdProduit = Me.N°IdProduit
strDésignation = Me.Désignation
strMouvements = Me.Mouvements
strEmplaçement = Me.Emplaçement
strDateModification = Me.DateModification
strprixAchatUHT = Me.[prix d'Achat UHT]
strIDMagasin = Me.N°IdMagasin
MsgBox " variabelen : " & strN°Document & " " & strN°IdProduit
strSql = "INSERT INTO Detailstock (" & strN°Document & "," & strN°IdProduit & "," & _
strDésignation & "," & strMouvements & "," & strEmplacement & "," & strDateModification & "," & _
strprixAchatUHT & strIDMagasin & ")"
strSql = strSql + "SELECT DetailStock.N°Document, DetailStock.N°IdProduit, DetailStock.Emplaçement, DetailStock.[prix de vente UHT], DetailStock.[Qte Commandee], DetailStock.Mouvements, " & _
"DetailStock.Tva, DetailStock.[Date modification], DetailStock.N°IDMagasin FROM DetailStock"
strSql = strSql + "WHERE (((DetailStock.N°Document) = " & Me.N°Document & "));"
MsgBox " show string sql : " & strSql
Else
Arrivée = -1
DateModification = Date
End If
End Sub |
Partager