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
| Private Sub Commande37_Click()
[Forms]![FacFournisseurs].[SFMVSF]![Valid] = "OUI"
[Forms]![FacFournisseurs]![SFMVSF].[Form]![Valid] = "OUI"
Dim DFACT As Single
Dim IDAR As Single
Dim AR As String
Dim val As String
Dim Qte_A As Single
Dim Prix_A As Single
Dim Total As Single
DFACT = [Forms]![FacFournisseurs]![SFMVSF].[Form]![ID_DfactFournisseur]
IDAR = [Forms]![FacFournisseurs]![SFMVSF].[Form]![ID_Articles]
AR = [Forms]![FacFournisseurs]![SFMVSF].[Form]![Designation]
Qte_A = [Forms]![FacFournisseurs]![SFMVSF].[Form]![Qte_A]
Prix_A = [Forms]![FacFournisseurs]![SFMVSF].[Form]![Prix_A]
Total = [Forms]![FacFournisseurs]![SFMVSF].[Form]![Total]
val = [Forms]![FacFournisseurs]![SFMVSF].[Form]![Valid]
Dim dbs As Database
' Modify this line to include the path to Northwind
' on your computer.
Set dbs = CurrentDb()
' Create a new record in the Employees table. The
' first name is Harry, the last name is Washington,
' and the job title is Trainee.
dbs.Execute " INSERT INTO MvS " _
& "(ID_MvS,ID_DfactFournisseur,ID_DfactClient, ID_Articles, Designation,Qte_V, Qte_A,Prix_V, Prix_A, TotalS, Valid) VALUES " _
& "( '', '" & DFACT & " ', '', '" & IDAR & "', '" & AR & ",'', " & Qte_A & " ','', '" & Prix_A & "', '" & Total & "', '" & val & "');"
dbs.Close
If val = "OUI" Then
Me.factval.Visible = True
Me.SFMVSF.Enabled = False
Me.NumFact.Enabled = False
Me.ID_FactFournisseur.Enabled = False
Me.ID_Fournisseur.Enabled = False
Me.Date_FactF.Enabled = False
Me.Heur_FactF.Enabled = False
Else
Me.factval.Visible = False
Me.SFMVSF.Enabled = True
Me.NumFact.Enabled = True
Me.ID_FactFournisseur.Enabled = True
Me.ID_Fournisseur.Enabled = True
Me.Date_FactF.Enabled = True
Me.Heur_FactF.Enabled = True
End If
End Sub |
Partager