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
|
Private Sub Commande10_Click()
Dim sql As String
Dim sql2 As String
Dim PU As Single
Dim cb As Variant
sql = " update boisson " & _
" set stock = Stock - Qc " & _
" where [NomB] = [BC] "
DoCmd.RunSQL sql
PU = DLookup("prix", "boisson", "NomB = '" & [BC] & "'")
cb = DLookup("codeb", "boisson", "NomB = '" & [BC] & "'")
sql2 = " INSERT INTO consommer ( date_conso, quantite, prix_unitaire, codeB )" & _
" VALUES ( DC, QC, PU, cb ) "
DoCmd.RunSQL sql2
End Sub |
Partager